Skip to content

Instantly share code, notes, and snippets.

@barinbritva
Last active Sep 2, 2020
Embed
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 user.name "Barin Britva"
git config --global user.email barinbritva@outlook.com
# Set author in project
git config user.name "Barin Britva"
git config user.email barinbritva@outlook.com
# Amend commit
git commit --amend --no-edit
# Amend commit, change author
git commit --amend --author="Barin Britva <barinbritva@outlook.com>" --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