0
我有一個遠程倉庫和一個本地倉庫。我做了git fetch --all
,看到我想在本地倉庫分支,我想創建一個本地跟蹤分行:Git:如何推送本地分支重命名遠程分支?
git checkout -t -b bug1000 origin/user/bug/1000
我的問題是,拉的都是正確的,但推的都沒有設置:
>$ 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(作爲寫作時最新的穩定)。
我看着添加推送線,但實際上有很多分支要跟蹤。添加推線然後使我無法簡單地推送給主... – utopiabound
請注意,您可以添加多個推送線,以便您可以使用與「正常」分支匹配的默認分支和特殊分支(或多個)來處理錯誤分支。 – twalberg