2013-02-28 81 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尚未推送。