Skip to content

Instantly share code, notes, and snippets.

@struts2spring
Created January 25, 2021 19:51
Show Gist options
  • Select an option

  • Save struts2spring/b32905037ea2bdc7cd0cbb4816ceaaae to your computer and use it in GitHub Desktop.

Select an option

Save struts2spring/b32905037ea2bdc7cd0cbb4816ceaaae to your computer and use it in GitHub Desktop.
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

  2. Get rid of all untracked changes git clean -f -d

  3. Print out a cool visualization of your log git log --pretty=oneline --graph --decorate --all

  4. Ask git for a changelog git shortlog <commit>..HEAD

  5. View the log for a specific date range git log --since='FEB 10 2016' --until='FEB 19 2016'

  6. List all git aliases git config -l | grep alias | sed 's/^alias\.//g'

  7. Search for commits that include a keyword git log -S"config. menu_items"

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

What Do you think? Add yours in replies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment