git 克隆所有分支 并 切换远程分支

克隆所有远程分支

  1. git clone http://github.xxx.com/project.git
    
  2. cd project
    
  3. git branch -a
    
    * master
      remotes/origin/HEAD -> origin/master
      remotes/origin/dev
      remotes/origin/master
    
  4. git checkout -b dev origin/dev  
    ### 作用是checkout远程的dev分支,在本地起名为dev分支,并切换到本地的dev分支
    
  5. git checkout dev // 切换回dev分支,开始开发
    

git 克隆单个远程分支

  1. git clone -b masterName http://github.xxx.com/project.git
    
posted @ 2021-03-11 14:07  柯宝宝智商感人  阅读(383)  评论(0编辑  收藏  举报