我如何找出哪些工作尚未推送到另一个存储库。换句话说;如果我要删除该存储库,我会永久丢失什么?
目前我使用以下 3 行,但我想知道这是否是一个完整的封面以及它是否是一个明智的方法:
git status --short
git log --branches --not --remotes --simplify-by-decoration --decorate --oneline
git stash list
更新:似乎没有检查子模块。有没有办法递归地包含子模块?
最佳答案
it seems that submodules are not checked. Is there a way to include submodules recursively?
不容易,因为每个子模块都可以有自己的历史、分支集和上游 repo('origin' 甚至另一个名称)
如“Git history including/interleave submodule commits”中所述,git log --submodules
将仅指示父存储库当前引用的 SHA1。
这给你留下了一个递归命令,如:
git submodule foreach git log
关于git 显示未推送的工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15134438/