Last active
January 15, 2024 07:52
-
-
Save architgarg/4155c0888004ec625ede75a0d826f9f3 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
Medium article here - https://medium.com/faun/these-git-aliases-will-make-your-life-super-easy-e12cd4b58167