Skip to content

Instantly share code, notes, and snippets.

@c0elha
Last active August 11, 2020 02:44
Show Gist options
  • Save c0elha/927a3fee01016f430aa5047668e7c55a to your computer and use it in GitHub Desktop.
Save c0elha/927a3fee01016f430aa5047668e7c55a to your computer and use it in GitHub Desktop.
Git alias
[alias]
ci = "!f() { git commit -m \"$*\"; }; f"
acst = "!f() { git add . && git commit -m \"$*\" && git status; }; f"
acp = "!f() { git add . && git commit -m \"$*\" && git push; }; f"
asth = "!f() { git add . && git stash; }; f"
co = checkout
ps = push
pso = push origin
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
cpm = !(git checkout master && git pull origin master)
cpd = !(git checkout develop && git pull origin develop)
cpp = !(git checkout production && git pull origin production)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment