Last active
February 29, 2020 14:24
-
-
Save lucianomlima/a72cfe59ad8a38789cd2c4430d9dbdc2 to your computer and use it in GitHub Desktop.
Usefull git alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete branch | |
# Usage: git delete branch-name | |
git config --global alias.delete 'branch -D' | |
# Update branch with prune refs | |
# Usage: git update master | |
git config --global alias.update '!git fetch origin -p && git merge $(git rev-parse --abbrev-ref @{u})' | |
# Last commit details | |
# Usage: git last | |
git config --global alias.last 'log -1 HEAD' | |
# Squash last X commits | |
# Usage: git squash 6 | |
git config --global alias.squash '!git fetch && git reset --mixed HEAD^@{u} && git merge --squash HEAD@{1}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment