2013-02-28 51 views
17

如何找出哪些工作尚未推送到其他存儲庫?換一種說法;如果我要刪除該存儲庫,我會永久丟失什麼?git show unpushed work

目前我使用下面的3行,但我想知道,如果這是一個完整的覆蓋,如果它是一個理智的方式:

git status --short 
git log --branches --not --remotes --simplify-by-decoration --decorate --oneline 
git stash list 

更新:看來,子模塊不檢查。有沒有辦法遞歸地包含子模塊?

+1

那些從谷歌來到這裏,參見[查看未壓縮Git提交](http://stackoverflow.com/questions/2016901/viewing-unpushed-git-commits) – 2013-05-19 11:15:50

回答

1

似乎子模塊沒有被檢查。有沒有辦法遞歸地包含子模塊?

不容易的,因爲每個子模塊都可以有自己的歷史,設置分支機構和上游回購(「原點」,甚至別稱)

正如在「Git history including/interleave submodule commits」所描述的,git log --submodules只想表明SHA1目前由父回購引用。

這使得你像一個遞歸命令:

git submodule foreach git log 
0

你可能會喜歡像git show-branch --color=always -a --more=15

*是您當地的回購,+表示其他回報。如果評論存在於回購協議中,則*/+將指示其存在。

什麼存在於您的master分支但不在origin/master尚未推送。