10 Git Tricks to Save Your Time and Efforts

What do you think?
#100DaysOfCode
[Thread] 📃👇
1. Checkout a single file from another branch

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

2. View the log without merge commits

`git log --oneline --no-merges`

3. Rewrite your last commit message
`git commit -v --amend`

4. Get rid of all untracked changes
`git clean -f -d`
5. Print out a cool visualization of your log
`git log --pretty=oneline --graph --decorate --all`

6. Ask git for a changelog
`git shortlog <commit>..HEAD`

7. View the log for a specific date range
`git log --since='FEB 10 2016' --until='FEB 19 2016'`
8. List all git aliases
`git config -l | grep alias | sed 's/^alias\\.//g' `

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

10. Super secret list of git tutorials
`git help -g`

What Do you think? Add yours in replies.
You can follow @GithubProjects.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.