我有一个远程存储库和一个本地存储库。我做了一个git fetch --all
并在本地仓库中看到了我想要的分支,我想创建一个本地跟踪分支:
git checkout -t -b bug1000 origin/user/bug/1000
我的问题是 pull 是正确的,但 push 没有设置:
>$ git remote show origin
* remote origin
Fetch URL: XXX
Push URL: XXX
HEAD branch: master
Remote branches:
maint tracked
master tracked
user/bug/1000 tracked
user/bug/1001 tracked
user/bug/1002 tracked
Local branches configured for 'git pull':
bug1000 merges with remote user/bug/1000
maint merges with remote maint
master merges with remote master
Local refs configured for 'git push':
maint pushes to maint (local out of date)
master pushes to master (local out of date)
我的.git/config
看起来是正确的:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = XXX
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "maint"]
remote = origin
merge = refs/heads/maint
[branch "bug1000"]
remote = origin
merge = refs/heads/user/bug/1000
我已经尝试过git push -u origin bug1000:user/bug/1000
了,但它并没有改变任何东西。
这是使用 git 1.7.10.2 (截至写作时最新稳定)。