Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git show unpushed work

Tags:

git

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?

like image 370
Corno Avatar asked Feb 28 '13 11:02

Corno


People also ask

How can I see Unpushed commits?

We can view the unpushed git commits using the git command. It will display all the commits that are made locally but not pushed to the remote git repository.

Can others see my commits?

You can opt into sharing your private contributions in your profile settings. Details of the issues, pull requests, and commits you have made on private repositories are only visible to your fellow repository collaborators.


1 Answers

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
like image 130
VonC Avatar answered Nov 14 '22 19:11

VonC