Skip to content

Instantly share code, notes, and snippets.

@byF
Last active August 8, 2021 09:43
Show Gist options
  • Save byF/3dc8bb647bea7ff61bfdbf31c227d40e to your computer and use it in GitHub Desktop.
Save byF/3dc8bb647bea7ff61bfdbf31c227d40e to your computer and use it in GitHub Desktop.
Git Cheatsheet
  • reword: git commit --amend or git commit --amend -m "New message"
  • edit last commit:
    1. git reset HEAD~
    2. make your changes
    3. git add your changes
    4. git commit -c ORIG_HEAD
  • git force-pull
  • git prune-local
  • git remove tags:
    • remote: git push --delete origin <tagname>
    • local: git tag -d <tag_name>
  • annotated signed tag: git tag -a v1.0.0 -s -m "v1.0.0"
  • cherry-pick N last commits from a branch: git cherry-pick $BRANCH~$N..$BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment