Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (29.3k points)

ref^ refers to the commit before ref, what about getting the commit after ref?

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

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

1 Answer

0 votes
by (50.2k points)

To list all the commits, starting from the current one, and then its child, and so on -

 we use a standard git log, but going the other way, you could use something like

git log --reverse --ancestry-path <commit-id>^..master

where commit-id is of the first commit that you want to show.

Browse Categories