Is there a way with to prevent “git stash pop” from marking files as modified?

后端 未结 2 744
予麋鹿
予麋鹿 2020-11-30 13:19

I implemented a git-hook to scan my commits through pyflakes and jshint, and after reading Yipit\'s commentary on why most pre-commit hooks are broken, I chose to implement

2条回答
  •  遥遥无期
    2020-11-30 14:02

    Are you sure the changes are non-existant? If the file is showing as modified, something has changed, even if it's whitespace or the permission (executable state) of a file. You can use git diff to see the changes. You can also review the changes by using the git commit -av command (the -v flag will display the diff of the commit).

    Your IDE is going to keep a current "buffer" state of a file. If that file changes on the disk (which git stash pop|apply will do), the IDE will recognize this and unless you have it set to automatically refresh the file (usually in your IDE settings/preferences), it may prompt you if you want to save the current buffer as a new file -- which is not typically necessary when using git -- or to re-load the buffer with the changed state of the file.

提交回复
热议问题