遵循git命令行的指示,坚持使用git无限循环。如果我已经更新了,为什么我不能推。它要我拉。所以我拉。我已经最新了。我需要推动我的东西。
$ git push
trace: built-in: git 'push'
trace: run_command: 'ssh' 'git@somewhere' 'git-receive-pack '\''rt.git'\'''
Enter passphrase for key '/blah/blah':
To git@somewhere: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 'git@somewhere: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' 'git@somewhere' '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 :(得分:0)
尝试
$ git co BRANCH-1600
$ git pull
$ git push
与release_1.0.1
分支相同。
或者您可以删除BRANCH-1600
& release_1.0.1
首先在远程仓库中分支。
$ git push :BRANCH-1600
$ git push :release_1.0.1
$ git push -u origin BRANCH-1600
$ git push -u origin release_1.0.1
我猜你已经回滚了一些提交(或提交--amend
arg),但你之前已经将它们推送到远程仓库。
如果您确定本地分支的来源是正确的,只需使用-f
arg强行将其推送到远程:
$ git push -f origin BRANCH-1600
$ git push -f origin release_1.0.1