Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers

500 comments

108k users

Browse Categories

...