在创建名称与远程分支名称匹配的分支时,推送和拉取的配置设置不同。
拥有当前的远程分支:
$ git branch -r
origin/HEAD -> origin/master
origin/master
origin/someBranch
并创建几个本地分支来跟踪远程分支:
$ git branch someBranch origin/someBranch
Branch someBranch set up to track remote branch someBranch from origin.
$ git branch someOtherBranch origin/someBranch
Branch someOtherBranch set up to track remote branch someBranch from origin.
检查跟踪和上游信息:
$ git remote show origin
* remote origin
Fetch URL: git@github.somewhere.com:maic/repo.git
Push URL: git@github.somewhere.com:maic/repo.git
HEAD branch: master
Remote branches:
master tracked
someBranch tracked
Local branches configured for 'git pull':
master merges with remote master
someBranch merges with remote someBranch
someOtherBranch merges with remote someBranch
Local refs configured for 'git push':
master pushes to master (up to date)
someBranch pushes to someBranch (up to date)
为什么在没有推送配置的情况下创建了第二个分支?