17

How can I find out what work is not yet pushed to another repository. In other words; what would I permanently loose if I was to delete that repository?

Currently I use the following 3 lines, but I would like to know if this is a complete cover and if it is a sane approach:

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

update: it seems that submodules are not checked. Is there a way to include submodules recursively?

Coen
  • 4,586
  • 4
  • 21
  • 38
  • 1
    those coming here from google, see [Viewing Unpushed Git Commits](http://stackoverflow.com/questions/2016901/viewing-unpushed-git-commits) – Ilia K. May 19 '13 at 11:15

2 Answers2

1

it seems that submodules are not checked. Is there a way to include submodules recursively?

Not easily, because each submodule can have its own history, set of branches and upstream repo ('origin' or even another name)

As described in "Git history including/interleave submodule commits", git log --submodules would just indicate the SHA1 currently referenced by the parent repo.

That leaves you with a recursive command like:

git submodule foreach git log
Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
0

You might like something like git show-branch --color=always -a --more=15?

The * is your local repo, the + indicates the others. If a comment is present in a repo, the */+ will indicate it's existence there.

What exists in your master branch but not in origin/master is not pushed yet.

sjas
  • 15,508
  • 11
  • 75
  • 80