Skip to content

Instantly share code, notes, and snippets.

@janetkuo
Forked from Tiagojdferreira/.gitconfig
Last active April 17, 2017 20:30
Show Gist options
  • Save janetkuo/11394d55b63fde655fcc8d3648a12bfd to your computer and use it in GitHub Desktop.
Save janetkuo/11394d55b63fde655fcc8d3648a12bfd to your computer and use it in GitHub Desktop.
[credential]
helper = cache --timeout=99999999999999999
[user]
name = Firstname Lastname
email = username@myEmail.com
[alias]
lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
log-file = log --follow --color --
co = checkout
cot = "!f() { git branch | grep $1 | xargs -I {} git co {}; }; f"
b = branch
cm = commit
st = status
rename = branch -m
rn = rename
ft = fetch
rb = rebase
pf = push -f
df = diff --color
fixup = commit -am fixup
clean-merged = ! git branch --merged | egrep -v \"(^\\*|master|dev)\" | xargs git branch -d
prune = fetch --prune
undo = reset --soft HEAD^
[core]
editor = vim
[push]
default = simple
# "push the current branch back to the branch whose changes are usually integrated into the current branch"
# "refuse to push if the upstream branch’s name is different from the local one"
# https://git-scm.com/docs/git-config#git-config-pushdefault
[http "https://gopkg.in"]
followRedirects = true
@janetkuo
Copy link
Author

cot - magical checkout that works with partial branch name
clean-merged - deletes branches that were merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment