If I Could Turn Back ...
If only there was an easy way to find the first commit in a Git repository…
That returns the SHA-1 hash of the first commit in the repo and you can use git show to actually see the commit details like this:
Or you can simply combine the commands:
This gets the job done, but it’s kind of ugly and in practice you need to map it to some Git alias or a shell alias to be able to use it effectively. Here’s the shell alias approach:
At this point it’s time for the twist it our story. Turns out there’s a much simpler way to get to the beginning of your history:
Reference:
My site is free of ads and trackers. Was this post helpful to you? Why not
Disqus is great for comments/feedback but I had no idea it came with these gaudy ads.