Skip to content

Instantly share code, notes, and snippets.

@jiacona
Last active July 26, 2016 09:25
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 jiacona/2659ad2e290bda2fc6869f67b2d32b98 to your computer and use it in GitHub Desktop.
Save jiacona/2659ad2e290bda2fc6869f67b2d32b98 to your computer and use it in GitHub Desktop.
Essential git config
[alias]
amend = commit --amend
br = branch
ci = commit
co = checkout
exclude = !sh -c 'mkdir -p .git/info && echo "$1" >> .git/info/exclude' -
get = !git pull && git submodule init && git submodule update
h = help
ignore = update-index --assume-unchanged
ignored = !git ls-files -v | grep "^[[:lower:]]"
lol = log --graph --oneline --decorate
lola = log --branches --tags --remotes --graph --oneline --decorate
put = "!f() { remote=${1:-origin}; git push -u $remote HEAD; }; f"
rmbranch = "!f() { git rmlocalbranch \"$1\"; git rmremotebranch \"$1\"; }; f"
rmlocalbranch = "!f() { git branch -D \"$1\"; }; f"
rmlocaltag = "!f() { git tag -d \"$1\"; }; f"
rmremotebranch = "!f() { git push origin :heads/$1; }; f"
rmremotetag = "!f() { git push origin :refs/tags/$1; }; f"
rmtag = "!f() { git rmlocaltag \"$1\"; git rmremotetag \"$1\"; }; f"
st = status
uncommit = reset HEAD^
unignore = update-index --no-assume-unchanged
unstage = reset HEAD
update-submodules = "!f() { git pull --recurse-submodules && git submodule update; }; f"
[apply]
whitespace = nowarn
[color]
ui = true
[core]
excludesfile = ~/.gitignore
preloadindex = true
pager = less -x4
[init]
templatedir = ~/.git_template
[push]
default = simple
[user]
email = <your email>
name = <your name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment