Skip to content

Instantly share code, notes, and snippets.

@J535D165
Last active November 11, 2019 08:01
Show Gist options
  • Save J535D165/ae0b7f9275d7530c9ccb9361b25f9bf0 to your computer and use it in GitHub Desktop.
Save J535D165/ae0b7f9275d7530c9ccb9361b25f9bf0 to your computer and use it in GitHub Desktop.
Git alias configuration
[alias]
st = status
cm = commit -m
co = checkout
master = checkout master
br = branch
branches = branch -a
remote-tags = ls-remote --tags origin
aa = add -A .
aacm = !git add -A . && git commit -m
fuck = reset --hard ORIG_HEAD
unstage = reset HEAD --
last = log -1 HEAD
log3 = log -3 HEAD
log10 = log -10 HEAD
log-graph = log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
log-stats = log --stat --abbrev-commit
upfork = !git checkout master && git pull upstream master && git push origin master
alias = config --get-regexp alias
# History rewriting actions like squash-rebase, squash-merge
squash-rebase = "!git checkout ${1} && git reset --soft $(git merge-base master HEAD) && git add . && git commit -m \"${2}\" && git rebase master && git checkout master && git merge ${1} #"
squash-merge = "!git checkout ${1} && git reset --soft $(git merge-base master HEAD) && git add . && git commit -m \"${2}\" && git checkout master && git merge ${1} #"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment