Can';尽管状态告诉我们“不要推git”;“最新的”;
Git状态显示“最新”: 但git推送失败:Can';尽管状态告诉我们“不要推git”;“最新的”;,git,Git,Git状态显示“最新”: 但git推送失败: [p] vh/prodos3_v3_graphs☰ * ± git push Username for 'https://git.42.de': vheinitz Password for 'https://me@git.42.de': To https://git.42.de/repo/prodos3.git ! [rejected] master -> master (non-fast-forward) ! [rejec
[p] vh/prodos3_v3_graphs☰ * ± git push
Username for 'https://git.42.de': vheinitz
Password for 'https://me@git.42.de':
To https://git.42.de/repo/prodos3.git
! [rejected] master -> master (non-fast-forward)
! [rejected] prodos3_v3_developer-all -> prodos3_v3_developer-all (non-fast-forward)
error: failed to push some refs to 'https://git.42.de/repo/prodos3.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因是什么?
首先,为什么git在输出中提到master?我不想强行进入主机,没有此分支的权限。您似乎有两个问题 至于最新消息:您是当前本地远程分支的最新消息,但不是服务器远程分支的最新消息。 执行
git pull
更新本地“远程分支”,然后执行push
git pull origin prodos3_v3_graphs
另一个问题是您正在推送所有本地分支。
您可以使用git push
指定要推送的分支,例如:
git push origin prodos3_v3_graphs
或者您可以配置git以推送到当前分支
git config --global push.default current
然后执行git推送
希望这有帮助:)太好了!这有帮助。问题似乎是,那个主人因为某种原因改变了,应该被拉走。我没有意识到,即使我签出了一个分支,我也在推所有分支。查看主控,拉,推,然后切换回我的分支帮助!很高兴听到:),您应该执行git config命令,这也会使git在将来推送更多对象,因为它是一个全局配置,将影响您的所有存储库。本地远程分支与服务器远程分支是什么?本地远程分支是您拥有的服务器分支的本地副本,只有在执行
git fetch
或git pull
命令时,才会更新它。git使用本地远程分支将本地分支与服务器进行比较,但不会自动更新。看见
git config --global push.default current