Skip to content

Instantly share code, notes, and snippets.

@ashgkwd
Created August 18, 2019 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashgkwd/841ebb4e604bd09cab35f906b422beee to your computer and use it in GitHub Desktop.
Save ashgkwd/841ebb4e604bd09cab35f906b422beee to your computer and use it in GitHub Desktop.
Some handy commands for Git users. Put it in your ~/.gitconfig
[core]
editor = vi
[alias]
spull = !git-svn fetch && git-svn rebase
spush = !git-svn dcommit
send = !git spull && git spush
up = pull --rebase
on = push origin master
co = checkout
ci = commit
ca = commit -a
br = branch
s = status
st = status
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
grc = rebase --continue
fixlast = commit --amend -C HEAD
undo = reset --hard
changes=diff --name-status -r
diffstat=diff --stat -r
serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
vee = log --decorate --cherry-mark --oneline --graph --boundary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment