【发布时间】:2015-07-10 06:46:33
【问题描述】:
当我执行git status 时,我看到一些文件发生了本地更改(似乎是缩进更改)。
当我执行git stash 时,它不会从队列中删除这些文件。它阻止我的自动拉脚本从远程 git 获取。
$ git stash
Saved working directory and index state WIP on develop: 05c60a5 Merge remote-tracking branch 'origin/develop' into develop
HEAD is now at 05c60a5 Merge remote-tracking branch 'origin/develop' into develop
$ git stash
On branch develop
Your branch and 'origin/develop' have diverged and have 23 and 127 different commit(s) each, respectively.
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: config/buznames/businessname_map.
modified: public/css/_lib/dropdown.less
modified: public/css/_lib/secureBadge.less
【问题讨论】:
-
运行
git diff看看有什么不同。是缩进还是行尾? -
它看起来像格式更改。内容完全删除并重新添加。
-
git checkout -- file似乎也不适用于这些文件。 -
您在某处有
.gitattributes文件吗?另外,git config core.autocrlf说什么? -
好吧,我就是这么想的。您应该将其设置为 false。另请参阅以下问题:Why should I use core.autocrlf=true in Git?、How to remove unstaged changes in git? 和 Unstaged changes left after git --reset hard。