代码之家  ›  专栏  ›  技术社区  ›  serbaut

git没有检测到某些文件中的更改

  •  2
  • serbaut  · 技术社区  · 16 年前

    我设法使索引处于某些文件未按预期跟踪的状态。

    例如,我在工作目录中没有修改size.h和test.h:

    $ git-ls-files -st size.h test.h
    H 100644 de2c741b07d86f92bdd660626848072cb2bf510f 0     size.h
    H 100644 8bb24bc7483ffcfc0fc1a3761dc63e86a1b3e003 0     test.h
    $ git status
    # On branch master
    nothing to commit (working directory clean)
    

    然后我对两个文件做一些随机更改:

    $ fortune >> size.h
    $ fortune >> test.h
    

    $ git status
    # On branch master
    # Changed but not updated:
    #   (use "git add <file>..." to update what will be committed)
    #   (use "git checkout -- <file>..." to discard changes in working directory)
    #
    #       modified:   test.h
    #
    no changes added to commit (use "git add" and/or "git commit -a")
    

    $ rm .git/index
    $ git reset
    Unstaged changes after reset:
    M       size.h
    M       test.h
    $ git status
    # On branch master
    # Changed but not updated:
    #   (use "git add <file>..." to update what will be committed)
    #   (use "git checkout -- <file>..." to discard changes in working directory)
    #
    #       modified:   size.h
    #       modified:   test.h
    #
    no changes added to commit (use "git add" and/or "git commit -a")
    

    我的直觉是这是msysgit中的一个bug,可能与samba结合使用。有什么想法吗?

    2 回复  |  直到 16 年前
        1
  •  2
  •   VonC    16 年前

    我看到的唯一一个在samba上显示Git错误状态的bug是 GitX ticket 147
    这是一种相反的情况(git status显示了对一个未被修改的文件的修改),但它表明文件的某些元素(大小?日期?权利?)无法通过samba共享正确传输。

    -1h 没有帮助。

    Locking issue 众所周知,在samba共享上克隆repo时会发生这种情况。

        2
  •  2
  •   Joey Novak    13 年前

    我在版本1.7.9.msysgit.0中遇到此问题

    一旦我删除了子模块目录,删除了它们在.git/modules中的条目,并重新初始化和更新它们,问题就解决了。