vfc*_*sts 3 git conflict git-push
我试图推送到远程仓库,但继续得到下面的错误.
$ git push
To user@remote.net:/home/user/repos/remoterepo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'user@remote:/home/user/repos/remoterepo.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.
Run Code Online (Sandbox Code Playgroud)
git remote show origin节目master pushes to master (local out of date).我很肯定它不应该过时,因为我只从分支机构推出.
我有两个问题.
是否可以强制本地分支覆盖遥控器?拉取将覆盖更改,这些更改肯定会晚于存储库中的内容.
这是我第二次或第三次遇到这个问题.我唯一能想到的是git的本地版本git version 1.7.3.1.msysgit.0(在Windows上)和远程版本是git version 1.6.5(Ubuntu Jaunty).是否有可能不同的git版本可能导致一些损坏?
eck*_*kes 12
git push --force.但是,只有当你完全确定自上次以来没有人阅读过repo时才这样做push(请参阅如何将修改后的提交推送到远程Git存储库?进行深入讨论).git pull在你能够之前,似乎更像是你必须先push.我不认为这是与时间有关的错误.该消息表明服务器上有更新的提交(由提交哈希标识,而不是提交日期)...要查看,更改了什么,请使用... git fetch来代替git pull并查看更改git log origin/master...更新:与此同时,push学会了--force-with-lease确保您不会意外破坏某些内容的选项:https://developer.atlassian.com/blog/2015/04/force-with-lease/.--force尽可能地喜欢这个!
| 归档时间: |
|
| 查看次数: |
16828 次 |
| 最近记录: |