top | item 41553870

(no title)

Gepsens | 1 year ago

Sharing a few of my own :

# 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 --author=igosuki@gmail.com; }; 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.

discuss

order

No comments yet.