Schwern Schwern - 1 year ago 95
Git Question

How do I find the next commit in git?

refers to the commit before
, what about getting the commit after

For example, if I
git checkout 12345
how do I check out the next commit?


PS Yes, git's a DAG node pointer struct tree whatever. How do I find the commit after this one?

Answer Source

To list all the commits, starting from the current one, and then its child, and so on - basically standard git log, but going the other way in time, use something like

git log --reverse --ancestry-path 894e8b4e93d8f3^..master

where 894e8b4e93d8f3 is the first commit you want to show.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download