【发布时间】:2014-01-01 08:49:20
【问题描述】:
当我尝试使用“git pull”拉取我的 git 存储库时,它一直告诉我我有本地更改,尽管我没有触及任何提到的文件。有人可以解释这种行为并知道解决方案吗?
git 状态:
# On branch master
# Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
# (use "git pull" to update your local branch)
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: src/component/Provider.java
# modified: src/data/Cascading.java
#
no changes added to commit (use "git add" and/or "git commit -a")
解决了问题。实际上是我的错,没有注意到远程存储库已重置为以前的版本。不过,如果您遇到这种情况,Max Woolf 解释的解决方案将会奏效!
【问题讨论】:
-
如果你创建一个
git diff或者只是创建一个git commit . -m "."怎么办?? -
git status的输出是什么? -
在这些情况下正确的心态是 Git 是对的,而你是错的。你可能做了一些 Git 认为是改变的事情;请发布“git status”的输出以供审核。
-
更新了问题。
-
那么 Git 认为你对文件做了哪些更改 (
git diff)?