我使用git-for-windows v2.16.0并遇到以下问题,其中报告了here:
我最初的工作状态很干净;输出' git status':
git status
On branch beta
nothing to commit, working tree clean
然后我进行局部更改。输出git status
:
git status
On branch beta
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: app/src/main/java/android_serialport_api/sample/Debug.java
no changes added to commit (use "git add" and/or "git commit -a")
然后我用&#39; git stash&#39;
隐藏它们git stash
Saved working directory and index state WIP on beta: 2fca403 working on the console
现在我的工作目录应该是干净的,但git status
的输出仍然是:
git status
On branch beta
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: app/src/main/java/android_serialport_api/sample/Debug.java
no changes added to commit (use "git add" and/or "git commit -a")
(导致无法git checkout
等
答案 0 :(得分:2)
这是Git for Windows中的known bug,它在v2.16.0(3)中得到修复。更新到更新的版本将修复此错误。
感谢@choroba指出报告的问题!