Git: list all commits on all remote branches?

Git

Git Problem Overview


I would like to list all commits on all remote branches in my repository.

I just want the SHA1 for each commit.

Git Solutions


Solution 1 - Git

Try this -

> git log --branches=*

Solution 2 - Git

The following should do what you want:

git rev-list --remotes

The documentation for the --remotes option says:

> --remotes[=<pattern>] > > Pretend as if all the refs in refs/remotes are listed on the command line as <commit>. If <pattern> is given, limit remote-tracking branches to ones matching given shell glob. If pattern lacks ?, , or [, / at the end is implied.

As a point of pedantry, these are "remote-tracking branches" rather than "remote branches" - the latter is a somewhat ambiguous term in git, since you might be referring to a branch in remote repository or a remote-tracking branch (which is like a cache of the state of the branch in the remote repository).

Solution 3 - Git

Simple:

git rev-list --all --remotes

I hope that helps

Of course, drop the --all if you just want to list revisions in remotes (which 90% of the time will overlap those in your local branches)

Solution 4 - Git

If you want refrences with it use this--

git show-ref

Solution 5 - Git

For those of you who wants to copy/paste it from a GUI to, say Excel.

Sourcetree has a History function where you can see every commit from all branches, with description, time and author

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJackoView Question on Stackoverflow
Solution 1 - GitSGhoshView Answer on Stackoverflow
Solution 2 - GitMark LongairView Answer on Stackoverflow
Solution 3 - GitseheView Answer on Stackoverflow
Solution 4 - GitParmatmaView Answer on Stackoverflow
Solution 5 - GitMartin CarlssonView Answer on Stackoverflow