-
-
Save neelabalan/2c05e5c19c45754dc85ebd78904e32d5 to your computer and use it in GitHub Desktop.
Awesome git aliases - [For Medium Article]
This file contains 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
[alias] | |
br = branch | |
st = status -s -b | |
lg = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative -20 | |
ac = !git add -A && git commit -m | |
oops = !git add -A && git commit --amend --no-edit | |
unstash = stash pop | |
bd = branch -D | |
ch = checkout | |
chb = checkout -b | |
cht = checkout -t | |
current = rev-parse --abbrev-ref HEAD | |
pto = !CURRENT=$(git current) && git push origin $CURRENT | |
pfo = !CURRENT=$(git current) && git pull origin $CURRENT | |
rh = "!f() { \ | |
git reset --hard HEAD~$1; \ | |
}; f" | |
rs = "!f() { \ | |
git reset --soft HEAD~$1; \ | |
}; f" | |
rsh = "!f() { \ | |
git reset --soft $1; \ | |
}; f" | |
rhh = "!f() { \ | |
git reset --hard $1; \ | |
}; f" | |
rhH = !git add -A && reset --hard HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment