过去几天我在一个分支机构工作,当我合并它并尝试推动它时,我一直在收到这样的错误,任何人都可以对此有所了解
推动时:
To git@github.com:****************/88888888888888888.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:****************/88888888888888888.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.
提取时
error: unable to resolve reference refs/remotes/origin/wishlist: No error
From github.com:****************/88888888888888888
! [new branch] wishlist -> origin/wishlist (unable to update local ref)
答案 0 :(得分:3)
关于推送问题,GitHub州
处理“非快进”错误
在推送时,您可能会遇到此错误:
$ git push origin master To ../remote/ ! [rejected]
master -> master (non-fast forward) error: failed to push some refs to '../remote/'
To prevent you from losing history, non-fast-forward
updates were rejected Merge the remote changes before pushing again.
See the 'non-fast forward' section of 'git push --help' for details.
这个错误起初可能有点压倒性,不要害怕。简单地说,git无法在不丢失提交的情况下对远程进行更改,因此它拒绝推送。通常这是由另一个用户推送到同一分支引起的。您可以通过获取和合并远程分支来解决此问题,或使用pull来同时执行这两项操作。
在其他情况下,此错误是使用git commit --amend
或git rebase
等命令在本地进行的破坏性更改的结果。虽然您可以通过将--force
添加到push命令来覆盖远程,但只有在绝对确定这是您想要执行的操作时才应该这样做。强制推送可能会导致其他已提取的用户出现问题
远程分支,被认为是不好的做法。如有疑问,请勿强制推送。
关于提取问题,您是否可以使用以下命令中的verbose
模式提供更多信息(将<{1>}替换为您的遥控器)?
git fetch -v origin
修改强>
我刚刚克隆了你的GitHub repo而没有任何问题。您的本地仓库可能会略有损坏。如果没有您的本地origin
,config
文件,packed-refs
和logs
文件夹的副本,远程排查可能会非常棘手。
但是,有一种简单的方法可以解决提取问题。在另一个本地文件夹中克隆GitHub存储库的全新版本,然后从那里重新启动。这会重置您的引用并消除您的问题。