通常,當工作目錄乾淨時,我可以使用「git status」。輸出看起來像:Git:當工作目錄被修改時如何檢查本地分支是否在遠程分支之前?
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
但是,如果工作目錄進行修改,「混帳地位」輸出:
# On branch master
# 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: body/chap1.tex
#
no changes added to commit (use "git add" and/or "git commit -a")
第二個結果不顯示,如果我已經推動所有更改遠程分支機構。有時,當工作目錄被修改時,我仍然需要第一個結果。如何在這種情況下獲得它?
我在Windows系統上使用msys-git。它有點不同。 – river6