Skip to content

Instantly share code, notes, and snippets.

@Demwunz
Created July 3, 2020 16:47
Show Gist options
  • Save Demwunz/8d74edb6fa50042b06b12911142ddfc8 to your computer and use it in GitHub Desktop.
Save Demwunz/8d74edb6fa50042b06b12911142ddfc8 to your computer and use it in GitHub Desktop.
A collection of some useful git commands
# delete all local branches that have been merged into master
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -
# amend a commit to the current time
git commit --amend --date="now"
# add empty git commit without adding files
git commit --allow-empty -m "This will trigger a build"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment