Predictive Hacks

How to show past Git Commits

You can the past commits by typing:

git log

If you want to see the past commits, you can use the ancestor symbol ^ or the tilde ~. For example, let’s say that I want to see the parent commit of the HEAD. We can type:

git show HEAD^

Or

git show HEAD~1

Now, if we want to see the “grand-parent”, i.e. two steps back. We can type:

git show HEAD^^

Or

git show HEAD~2

Similarly, if we want to add more steps back, we add more ancestors, for example the three steps back will be HEAD^^^ or HEAD~3 if we use the tilde notation.

Finally, note that instead of the “HEAD” you can enter the corresponding SHA (or at least the first 7 characters of it).

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Python

Image Captioning with HuggingFace

Image captioning with AI is a fascinating application of artificial intelligence (AI) that involves generating textual descriptions for images automatically.

Python

Intro to Chatbots with HuggingFace

In this tutorial, we will show you how to use the Transformers library from HuggingFace to build chatbot pipelines. Let’s