Skip to content

Instantly share code, notes, and snippets.

Last active Jul 13, 2022
What would you like to do?
Git commands
# Delete local tag
git tag -d tagname
# Delete remote tag
git push origin :tagname
# Or
git push --delete origin tagname
# Set author globally
git config --global "Barin Britva"
git config --global
# Set author in project
git config "Barin Britva"
git config
name = John Doe
email = john@doe.tld
[includeIf "gitdir:~/work/"]
path = ~/work/.gitconfig
# Amend commit
git commit --amend --no-edit
# Amend commit, change author
git commit --amend --author="Barin Britva <>" --no-edit
# Remove commit
git reset --hard needed-commit-hash
git push origin -f
# Remove tag
# remote repository
git push --delete origin tagname
# locally
git tag --delete tagname
# Remove all tags
# remote repository
git tag -l | xargs -n 1 git push --delete origin
# locally
git tag | xargs git tag -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment