git工作目录随机不干净
我有一个奇怪的问题,导致我的工作目录在与github交互后随机变脏 通常我会检查我的更改:git工作目录随机不干净,git,github,Git,Github,我有一个奇怪的问题,导致我的工作目录在与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 -- <
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 pull --rebase
Enter passphrase for key '/root/.ssh/id_rsa':
Current branch development is up to date.
推送:
检查我的状态,所有更改文件!!“真奇怪,我没有编辑这些…”
有人熟悉这种奇怪的行为吗
这是正常的吗?我是否做了一些完全错误的事情,或者这可能是git中的一个bug?检查了行尾
git diff
将清楚地显示它们。行尾和没有可靠时间戳(即FAT)的文件系统将是您这里最大的两个疑点……当问题通过git重置解决时,行尾或时间戳怎么会成为问题?这个系统是我mac电脑上的虚拟debian机器。
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)