alias gitlg="git log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit"
From http://stackoverflow.com/questions/1057564/pretty-git-branch...
I wonder if there's something about it that makes it forgettable? I don't know if I can present it any differently, maybe there's a better way of presenting it to make it more appealing.
# https://github.com/Igosuki/dotfiles/blob/master/git/.gitconf...
grep = grep -Ii
lalias = "!git config -l | grep alias | cut -c 7-"
done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
lasttag = describe --tags --abbrev=0
lt = describe --tags --abbrev=0
dr = "!f() { git diff "$1"^.."$1"; }; f"
lc = "!f() { git ll "$1"^.."$1"; }; f"
diffr = "!f() { git diff "$1"^.."$1"; }; f"
lb = " !f() { git branch -a | more; }; f"
cp = cherry-pick
st = status -s
cl = clone
ci = commit
br = branch
diff = diff --work-diff
dc = diff --cached
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset --hard HEAD^
rh2 = reset --hard HEAD^^
sl = stash list
sa = stash apply
ss = stash save
logtree = log --graph --oneline --decorate --all
lmine = "!f() { git log --branches [email protected]; }; f"
purgeforever = "!f() { git filter-branch --prune-empty -d /dev/shm/scratch --index-filter "git rm --cached -f --ignore-unmatch $1" --tag-name-filter cat -- --all }"
updaterefsafterpurge = "f() { git update-ref -d refs/original/refs/heads/master; git reflog expire --expire=now --all; git gc --prune=now }"
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
pr = pull --rebase
I'd advise binding things like pr, po, cp, --rebase, --continue, to keyboard shortcuts though if you are in an IDE.
I always think about using "clean up a pull request" as a fizzbuzz-ish screen in interviews. It just seems like a decent proxy for "do you care at all?".
# https://stackoverflow.com/questions/4298960/git-add-a-git-co...
git config --global alias.ac '!git add -A && git commit'
git config --global alias.acm '!git add -A && git commit -m'
git config --global alias.ll '!git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"'
git config --global alias.gst '!git status'
git config --global alias.gca '!git commit -a --amend'
git config --global alias.gp '!git push origin HEAD'
git config --global alias.bd '!git branch -d'
git config --global alias.bdd '!git branch -D'
git config --global alias.mc '!git diff --name-only --diff-filter=U'
git config --global alias.co '!git checkout'
git config --global alias.po '!git push origin'
git config --global alias.cp '!git add -A && git commit -m "Content" && git push'
Out of those, I only – but often – use `git acm` and `git co` and `git po`.
Edit: formatting (oh dear).