Salman Qureshi
Salman Qureshi's Blog

Salman Qureshi's Blog

Git Tricks & Hacks To Be More Productive That Will Save Your Time

Salman Qureshi
ยทJan 25, 2021ยท

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Want to speed up your git skills?

Yes Open Source is the future that needs git skills and every modern IT companies needs collaborative work and Continuous Integration (CI) you will need git CLI skills there as well.

Today we will learn to be more productive in terms of git CLI commands.

10 Git Tricks to Save Your Time and Efforts ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡

  1. Checkout a single file from another branch

git checkout some-other-branch -- yarn.lock

  1. View the log without merge commits`

git log --oneline --no-merges`

  1. Rewrite your last commit message`

git commit -v --amend`

  1. Get rid of all untracked changes

git clean -f -d

  1. Print out a cool visualization of your log

git log --pretty=oneline --graph --decorate --all

  1. Ask git for a changelog

git shortlog <commit>..HEAD

  1. View the log for a specific date range

git log --since='FEB 10 2016' --until='FEB 19 2016'

  1. List all git aliases

git config -l | grep alias | sed 's/^alias\.//g'

  1. Search for commits that include a keyword

git log -S"config. menu_items"

  1. Super secret list of git tutorials git help -g

What Do you think? Add yours in replies.

Did you find this article valuable?

Support Salman Qureshi by becoming a sponsor. Any amount is appreciated!

See recent sponsors |ย Learn more about Hashnode Sponsors
ย 
Share this

Impressum

This blog is a source of my experiences and what I learn throughout my journeys. I am no expert, I just try to make sense of the things I encounter.