Skip to content

Instantly share code, notes, and snippets.

@nicohq
Last active September 20, 2016 08:16
Show Gist options
  • Save nicohq/97219794cfdb195584963e882e10ab22 to your computer and use it in GitHub Desktop.
Save nicohq/97219794cfdb195584963e882e10ab22 to your computer and use it in GitHub Desktop.
Git tips

To delete all local branches that are already merged into the currently checked out branch exclude master, stage branches
git branch --merged | egrep -v "(^\*|master|stage)" | xargs git branch -d

See how many lines of code you have written today
git diff --shortstat "@{0 day ago}"

Uncommit something (3 commit back)
git reset --soft HEAD~3

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