3
echo Hello. > a.txt
git add .
echo Bye. >> a.txt
git status -s
>>> AM

AM状態がであることがわかりますが、
次のことを行うと

git stash
git stash pop
git status -s
>>> A

状態はAです。なぜM国家は失われたのですか?

4

1 に答える 1

2

これは予期される動作です。期待どおりに再構築するには(A&Mを保存)使用します

git stash pop --index

ドキュメントから:

git-stash(1):

If the --index option is used, then tries to reinstate not only the working
tree’s hanges, but also the index’s ones. However, this can fail, when you have
conflicts (which are stored in the index, where you therefore can no longer apply
the changes as they were originally).
于 2012-12-17T17:23:15.563 に答える