2012-11-27 46 views
2

按照git命令行的說明卡在git無限循環中。如果我已經是最新的,爲什麼我不能推。這是要求我拉。所以我拉。我已經是最新的了。我需要推動我的東西。Git無限循環

$ git push 
trace: built-in: git 'push' 
trace: run_command: 'ssh' '[email protected]' 'git-receive-pack '\''rt.git'\''' 
Enter passphrase for key '/blah/blah': 
To [email protected]:rt.git 
! [rejected]  BRANCH-1600 -> BRANCH-1600 (non-fast-forward) 
! [rejected]  release_1.0.1 -> release_1.0.1 (non-fast-forward) 
error: failed to push some refs to '[email protected]:rt.git' 
To prevent you from losing history, non-fast-forward updates were rejected 
Merge the remote changes (e.g. 'git pull') before pushing again. See the 
'Note about fast-forwards' section of 'git push --help' for details. 


$ git pull 
trace: exec: 'git-pull' 
trace: run_command: 'git-pull' 
trace: built-in: git 'rev-parse' '--git-dir' 
trace: built-in: git 'rev-parse' '--is-bare-repository' 
trace: built-in: git 'rev-parse' '--show-toplevel' 
trace: built-in: git 'ls-files' '-u' 
trace: built-in: git 'symbolic-ref' '-q' 'HEAD' 
trace: built-in: git 'config' '--bool' 'branch.BRANCH-1600.rebase' 
trace: built-in: git 'config' '--bool' 'pull.rebase' 
trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD' 
trace: built-in: git 'fetch' '--update-head-ok' 
trace: run_command: 'ssh' '[email protected]' 'git-upload-pack '\''rt.git'\''' 
Enter passphrase for key '/home/achen/.ssh/id_rsa': 
trace: run_command: 'rev-list' '--verify-objects' '--stdin' '--not' '--all' '--quiet' 
trace: run_command: 'rev-list' '--verify-objects' '--stdin' '--not' '--all' 
trace: exec: 'git' 'rev-list' '--verify-objects' '--stdin' '--not' '--all' 
trace: built-in: git 'rev-list' '--verify-objects' '--stdin' '--not' '--all' 
trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD' 
trace: built-in: git 'fmt-merge-msg' 
trace: built-in: git 'merge' 'Merge branch '\''rel_3.6.0'\'' of somewhere:rt into RTDE             V-1600' 'HEAD' '6ba69b1fc5973ecbc5cef61a3846a901ca82c17a' 
Already up-to-date. 

回答

0

嘗試

$ git co BRANCH-1600 
$ git pull 
$ git push 

,並以相同的分支​​。

或者您可以刪除BRANCH-1600 &​​首先在遠程回購分支。

$ git push :BRANCH-1600 
$ git push :release_1.0.1 
$ git push -u origin BRANCH-1600 
$ git push -u origin release_1.0.1 

我猜你rollbacked作了一次提交(或--amend ARG提交),但你之前已經推到遠程回購。

如果你確定你的本地分支的來源是正確的,只是-f ARG推到遠程強行:

$ git push -f origin BRANCH-1600 
$ git push -f origin release_1.0.1 
+0

我只是做了該分支的git的CO(結賬)和它說我已經在BRANCH-1600上。做git pull和git push會得到相同的結果(預期)。這裏的工作流程的一部分是使用Gitlab,我不能隨意刪除或刪除存儲庫。尤其不是Gitlab上的發佈分支。 – user1855069

+0

@ user1855069如果您確定本地分支的來源是正確的,請嘗試用'-f' arg推送。看到我的答案的新版本。 :) – Kjuly