git 切换到本地不存在但远端存在的分支
使用背景
比如有人往remote推送了一个新的分支,自己本地没有,但想同步到本地
git switch
- 首先
git branch -r,找到你需要的那个分支名称 -
origin/HEAD -> origin/master origin/newBranch git switch newBranch本地没有这个新分支,git switch命令会自动创建并跟踪
参考
https://stackoverflow.com/questions/9537392/git-fetch-remote-branch

浙公网安备 33010602011771号