我正在和一位开发人员一起工作,他们正在看到一个我以前从未遇到过的奇怪问题.他正在开发一个存储库,需要在推送之前从其他人那里获取最新的更改.他所有的改变都是承诺的.
$ git pull
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.
Run Code Online (Sandbox Code Playgroud)
这看起来很合理,直到......
$ git status
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 3 and 1 different commit each, respectively.
#
nothing to commit (working directory clean)
Run Code Online (Sandbox Code Playgroud)
说什么?
我git reset --hard HEAD在拉动之前已经尝试过,但拉动仍然失败.
只有一个人看到这个,他在Mac上(OSX 10.6.8).有任何想法吗?我要把头发拉出来.
Pet*_*oes 22
代替
git pull
Run Code Online (Sandbox Code Playgroud)
尝试
git fetch
git rebase -p origin/master
Run Code Online (Sandbox Code Playgroud)
如果这不起作用,你可以尝试
git pull --no-rebase
Run Code Online (Sandbox Code Playgroud)
如何检查此消息发生的原因
确保你在树枝上,而不是一个独立的头.重新定位不适用于分离头.
运行以下命令,结果应该是无输出.
git update-index -q --ignore-submodules --refresh
git diff-files --ignore-submodules
git diff-index --cached --ignore-submodules HEAD --
Run Code Online (Sandbox Code Playgroud)
您是在使用本地文件系统还是nfs共享?
当我在nfs共享上工作时,我遇到了完全相同的问题.
我已经noatime为mount命令添加了选项,它有助于:
mount -t nfs -o noatime,... device dir
Run Code Online (Sandbox Code Playgroud)