无法取消b / c“您有未执行的更改”,但状态表示没有更改 [英] Cannot Pull b/c "You have unstaged changes", but status says there are no changes

查看:165
本文介绍了无法取消b / c“您有未执行的更改”,但状态表示没有更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在和一名开发人员一起工作,他看到一个我从未遇到过的奇怪问题。他正在开发一个存储库,并且需要在推出之前从其他人处获取最新的更改。

  $ git pull 
无法使用rebase进行拉取:您有未执行的更改。
请提交或储存它们。

这似乎够理直到......

  $ git status 
#分支主
#你的分支和'origin / master'有分歧,
#有3个和1个不同的提交每个,分别。
$
没有提交(工作目录干净)

说什么? / p>

在拉动之前,我已经尝试过 git reset --hard HEAD ,但仍然失败。



只有一个人看到这个,他在Mac上(OSX 10.6.8)。有任何想法吗?

解决方案

而不是

  git pull 

try

  git fetch 
git rebase -p origin / master

如果这不起作用,您可以尝试

  git pull --no-rebase 

如何检查此讯息发生的原因



确保你在一个分支上,而不是一个独立的头上。重新启动不适用于分离的头部。



运行以下命令,结果应该是不输出。

  git update-index -q --ignore-submodules --refresh 
git diff-files --ignore-submodules
git diff-index --cached --ignore-submodules HEAD -


I'm working with a developer here who is seeing a weird issue that I've never encountered before. He's working on a repository and needs to pull the latest changes from someone else before he can push. All of his changes are committed.

$ git pull
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.

Which seems reasonable enough until...

$ 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)

Say what?

I've tried git reset --hard HEAD before pulling, but the pull still fails.

Only one guy is seeing this and he's on a Mac (OSX 10.6.8). Any ideas? I'm about to pull my hair out.

解决方案

Instead of

git pull

try

git fetch
git rebase -p origin/master

If that doesn't work you can try

git pull --no-rebase

How to check why this message occurs

Make sure you on a branch, not a detached head. Rebasing doesn't work on a detached head.

Run the following commands, the result should be no output.

git update-index -q --ignore-submodules --refresh
git diff-files --ignore-submodules
git diff-index --cached --ignore-submodules HEAD --

这篇关于无法取消b / c“您有未执行的更改”,但状态表示没有更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆