Getting existing git branches to track remote branches

前端 未结 7 950
一整个雨季
一整个雨季 2021-01-29 21:43

My usual workflow when working with git, is something like this:

  1. create a local repository
  2. do some work in that repository, add/change files etc.
7条回答
  •  离开以前
    2021-01-29 22:09

    You can also use this if you want to create a new local branch to track a remote branch:

    git checkout --track -b [branch_name] --track origin[or other remote name]/[remote_branch_name] 
    

    or even better:

    git checkout -t origin/branch_name
    

提交回复
热议问题