简体   繁体   中英

Git: list all commits on all remote branches?

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

I just want the SHA1 for each commit.

Try this -

git log --branches=*

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).

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)

如果你想参考它使用这个 -

git show-ref

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM