Skip to content

Instantly share code, notes, and snippets.

@h3h
Created June 8, 2011 17:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3h/1014925 to your computer and use it in GitHub Desktop.
Save h3h/1014925 to your computer and use it in GitHub Desktop.
My global .gitconfig
[user]
name = Brad Fults
email = bfults@gmail.com
[alias]
amend = commit --amend
co = checkout
st = status
cp = cherry-pick
# edit config (global, local)
ec = !vim ~/.gitconfig
ecl = !vim .git/config
# log graph
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# rebase interactive (local commits on master)
rbi = rebase -i origin/master
# edit conflicted files
ecf = !$EDITOR $(git ls-conflicted-files)
ls-conflicted-files = ls-files --unmerged
human = name-rev --name-only --refs=refs/heads/*
[color]
status = auto
[color "status"]
added = green
changed = cyan
untracked = yellow
[branch]
autosetupmerge = true
autosetuprebase = always
[clean]
requireForce = false
[push]
default = tracking
[github]
user = h3h
token = ...
[help]
autocorrect = 1
[rerere]
enabled = 1
[core]
autocrlf = input
export GIT_EDITOR="/usr/bin/mate -w"
function gcb()
{
git branch | grep '^\*' | cut -c3-
}
function gbp()
{
git fetch && git rebase origin/`gcb`
}
function gpu()
{
git push origin `gcb`
}
alias ga="git add"
alias gaa="git add ."
alias gf="git fetch"
alias gp="git pull"
alias gst="git status -s"
alias gbr="git branch $@"
alias gdi="git diff $@ | mate"
alias gdic="git diff --cached | mate"
alias gsl="git stash list"
alias gsa="git stash pop"
alias gcl="git clean | grep -v 'Not removing'"
alias gg="git commit -v"
alias gpr="git pull --rebase"
alias gk="gitk --all &"
alias gx="gitx"
alias gpp="gp && gpu"
gpa()
{
for branch in `git branch | cut -c 3-`; do
git co $branch && git pull;
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment