Git:在根级别“无需提交”,但未修改的文件在子文件夹中显示为已修改

时间:2011-11-23 17:03:19

标签: git

我对git有一个奇怪的问题。我的文件夹结构是(简化的),如下所示:

  /wte/
  /wte/bib
  /wte/MATLAB
  /wte/MATLAB/lib
  /wte/MATLAB/simdp

这些文件夹(前两个文件夹)都包含文件。

现在,如果我在git status/wte/

$ git st
# On branch master
# Your branch is ahead of 'origin/master' by 4 commits.
#
nothing to commit (working directory clean)

但是如果我在git status(或/wte/MATLAB/)中/wte/bib/执行:

$ git st
# On branch master
# Your branch is ahead of 'origin/master' by 4 commits.
#
# 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:   ../MATLAB/lib/XSteam_Matlab_v2.6/X Steam for Matlab.pdf
#       modified:   ../MATLAB/lib/XSteam_Matlab_v2.6/XSteam.m
#       modified:   ../MATLAB/lib/XSteam_Matlab_v2.6/XSteamUS.m
#       modified:   ../MATLAB/simdp/extract_mdp_parallel.m
#       modified:   ../MATLAB/simdp/get_virgin_source_states.m
#       modified:   ../MATLAB/simdp/proj.sublime-project
#       modified:   ../MATLAB/simdp/proj.sublime-workspace
#       modified:   ../MATLAB/simdp/tests/T_get_virgin_source_states.m
#       modified:   ../MATLAB/simdp/tests/run_tests.m
#
no changes added to commit (use "git add" and/or "git commit -a")

这些文件尚未修改:

ost@d-win-1 ~/ba/wte/MATLAB
$ git diff simdp/get_virgin_source_states.m 

ost@d-win-1 ~/ba/wte/MATLAB
$ git diff simdp/extract_mdp_parallel.m 

ost@d-win-1 ~/ba/wte/MATLAB
$ git diff lib/XSteam_Matlab_v2.6/XSteam.m 

那么这里发生了什么?有什么想法吗?

请注意,这些不是所有文件,只是其中一些......

谢谢!

系统:

  • Windows 7(64位)
  • Git 1.7.5.1
  • Cygwin的

2 个答案:

答案 0 :(得分:0)

http://git-scm.com/download/win安装普通git。

我遇到了同样的问题,所以我刚刚删除了cygwin的git并安装了正常的git,问题就消失了。

答案 1 :(得分:0)

我认为区别在于文件模式。对于Windows,您应该尝试git config --global core.fileMode false。更多信息here