Git clone, git commit, git push. That’s part of the bread and butter of any developer nowadays.
But why stop there? Git is a much more powerful software and it would be boring to only do such. Here are 5 not so well known tricks that have saved me hours in my life as a software developer.
Let’s look at the 5 tricks using Watermelon’s repo as an example.
git reflog
Run this when you screwed everything and need a time machine
This is the one I use the most. A lot of times you want to go back in time to when stuff worked. Sometimes you accidentally delete stuff, or merge bad code. Reflog fixes this.
You will see the list of all things you’ve done across branches. With reset, you will be able to go back to that moment.
git log
Run this when when you want to see how a file has changed throughout time
This one is basically a movie rewind. I run this when I want to understand how a file has changed. It might be that