git工作目录随机不干净

时间:2013-08-23 14:04:07

标签: git github

我有一个奇怪的问题,这个Git仓库导致我的工作目录在与github进行一些交互后随机变脏。

通常我会检查我的更改:

root@debian:/var/www/MyDir# git status
    # On branch development
    # 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:   path-to-some-file1.css
    #   modified:   path-to-some-file2.js
    #   modified:   path-to-some-file3.html
    #
    no changes added to commit (use "git add" and/or "git commit -a")

提交他们:

root@debian:/var/www/MyDir# git commit -am "my custom"
    [development e9e4235] my custom
     3 files changed, 21 insertions(+), 48 deletions(-)

拉和rebase导致我的更改很小,我不需要额外的'合并'提交:

root@debian:/var/www/MyDir# git pull --rebase
    Enter passphrase for key '/root/.ssh/id_rsa': 
    Current branch development is up to date.

推送:

root@debian:/var/www/MyDir# git push
    Enter passphrase for key '/root/.ssh/id_rsa': 
    Counting objects: 21, done.
    Compressing objects: 100% (10/10), done.
    Writing objects: 100% (11/11), 1013 bytes, done.
    Total 11 (delta 9), reused 0 (delta 0)
    To git@github.com:User/MyRepo.git
       72612a8..e9e4235  HEAD -> development

检查我的状态,所有更改文件!! “这很奇怪,我没有编辑那些......”

root@debian:/var/www/MyDir# git status
    # On branch development
    # Changes to be committed:
    #   (use "git reset HEAD <file>..." to unstage)
    #
    #   modified:   path-to-some-file-a-coworker-edited-in-a-previous-commit-4.css
    #   modified:   path-to-some-file-a-coworker-edited-in-a-previous-commit-5.css
    #   modified:   path-to-some-file-a-coworker-edited-in-a-previous-commit-6.css
    #   modified:   path-to-some-file-a-coworker-edited-in-a-previous-commit-7.css
    #
    # 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:   path-to-some-file-a-coworker-edited-in-a-previous-commit-4.css
    #   modified:   path-to-some-file-a-coworker-edited-in-a-previous-commit-5.css
    #   modified:   path-to-some-file-a-coworker-edited-in-a-previous-commit-6.css
    #   modified:   path-to-some-file-a-coworker-edited-in-a-previous-commit-7.css
    #

重置修复它:

root@debian:/var/www/MyDir# git reset

root@debian:/var/www/MyDir# git status
    # On branch development
    nothing to commit (working directory clean)

有谁熟悉这种奇怪的行为?

这是正常的吗?我做错了什么或者这可能是git中的错误吗?

0 个答案:

没有答案