12

我使用 git-for-windows v2.16.0 遇到了以下问题,这里也有报告:

我最初有一个干净的工作状态;'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")

然后我用'git stash'隐藏它们:

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等。

4

2 回答 2

2

这是 Windows 版 Git 中的一个已知错误,已在 v2.16.0(3) 中修复。更新到较新的版本将修复此错误。

感谢@choroba 指出报告的问题!

于 2018-02-07T20:16:21.047 回答
0

最近,git status使用瓷器 v2在此处展示)可能仍不会显示隐藏的文件编号

git status --porcelain=v2 --show-stash 

使用 Git 2.34(2021 年第四季度),它现在允许 " git status --porcelain=v2" ( man )显示存储条目的数量,--show-stash就像正常输出一样。

请参阅Øystein Walle ( ) 的提交 2e59e78提交 612942a(2021 年 10 月 22 日(由Junio C Hamano 合并 -- --dea96aa 提交中,2021 年 11 月 29 日)Osse
gitster

status: 打印存储信息--porcelain=v2 --show-stash

签字人:Øystein Walle

v2瓷器格式非常方便获取有关repo当前状态的大量信息,但不包含有关stash的任何信息。
' git status' ( man )已经接受--show-stash,但在给出 --porcelain=v2 时会默默地忽略它。

让我们添加一个简单的行来打印存储条目的数量,但格式与其余格式的样式相似。

git status现在在其手册页中包含:

藏匿信息

如果--show-stash给出,则打印一行显示存储条目的数量(如果非零):

于 2021-12-05T06:16:14.567 回答