Skip to content

Instantly share code, notes, and snippets.

@feifanzhou
Last active August 21, 2019 14:14
Show Gist options
  • Save feifanzhou/d8f6a3d75ac31f3241028a9aa5183304 to your computer and use it in GitHub Desktop.
Save feifanzhou/d8f6a3d75ac31f3241028a9aa5183304 to your computer and use it in GitHub Desktop.
Git settings I use
# http://haacked.com/archive/2014/07/28/github-flow-aliases/
# https://gist.github.com/mwhite/6887990
# https://stackoverflow.com/a/5188364/472768
[alias]
branches = branch --sort=-committerdate
count = count-objects -vH
co = checkout
col = checkout @{-1}
com = checkout master
newbr = checkout -b
newb = checkout -b
pom = push origin master
plom = pull origin master
lom = pull origin master
cm = commit -m
amend = commit -a --amend
s = status -s
l = log --graph --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
d = diff
da = diff --cached
ac = !git add . && git commit -am
ca = !git add . && git commit -am
bb = !git checkout master && git pull --rebase origin master && git branch --delete @{-1}
uncommit = reset HEAD^
sd = stash show -p
stashdiff = stash show -p
sl = stash list
stashlist = stash list
um = pull --rebase origin master
reset-all = !git reset --hard HEAD && git clean -df
[push]
default = current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment