Member-only story

8 Advanced Git Commands to Increase Efficiency in Versioning

Ali Zeynalli
3 min readJun 7, 2022

--

Photo by Maarten Deckers on Unsplash

Working with Versioning Tools for Source Code Management has been must-to-know in last decade for Software Engineers. Tools like GitHub, Bitbucket etc. are pretty popular in Software Engineering world that all have their own specifications with some common functionalities instead. Being familiar with Git Commands gives the user more freedom and functionalities of CLI over working with GUI. I am not going to scan over basic commands like git pull/push, but picked out some advanced commands that I personally find very usefull in different situations.

git log…

git log command will show you all commits that has been done to the repository. This command is very useful when you need commit hash later for example git cherry-pick. This command would show all commits if you don’t filter them. Flags like“-n” “-author” “-before” “-after” would filter logs by number, person that did commit or before and after given date.

Following command for instance, would show me my most recent 1 commit before February 22:

git log -n 1 -before=”22–02–2022" -author=”Zeynalli”

git show <commit hash>…

git show command with given commit hash will output detailed information about specific commit such as name of classes and actual committed code.

--

--

Ali Zeynalli
Ali Zeynalli

Written by Ali Zeynalli

IT-Architect | BMW Group | M.Sc. Technical University of Berlin

No responses yet