From: Jannik Zander Date: Mon, 16 May 2016 09:57:33 +0000 (+0200) Subject: Better git undo X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=d8ce50772e13353028b26b678e8aeabe0dae1199;p=dotfiles.git Better git undo --- diff --git a/.bash/aliases b/.bash/aliases index 2454091..75eaa0c 100644 --- a/.bash/aliases +++ b/.bash/aliases @@ -31,9 +31,9 @@ alias egrep='egrep --color=auto' # show differences in color alias fgrep='fgrep --color=auto' # show differences in color # Shortcuts +alias g="git" alias h="history" alias j="jobs" -alias gx="global -gxr" LS_COMMON="-hF" #LS_COMMON="$LS_COMMON -I NTUSER.\* -I ntuser.\*" diff --git a/.gitconfig b/.gitconfig index fcedc50..6ef32a6 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,47 +1,39 @@ [alias] - aa = add --all + aa = add -uv + unaa = reset --mixed HEAD + uhaa = reset --hard HEAD br = branch - bv = branch -vv - ba = branch -ra - bd = branch -d + brv = branch -vv + bra = branch -ra + brd = branch -d + brdm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" co = checkout - cb = checkout -b + cob = checkout -b + go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" ci = commit -v - ca = commit -av --amend - cm = commit -a --amend -C HEAD - df = diff + cia = commit -av + ciam = commit -av --amend + unci = reset --mixed HEAD~ + uhci = reset --hard HEAD~ dt = difftool - dc = diff --cached - mg = merge + dtc = difftool --cached mt = mergetool st = status --short --branch tg = tag -l + reb = "!r() { git rebase -i HEAD~$1; }; r" pu = push --tags pl = pull --rebase ed = config --global -e - ls = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph + lg = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat - tail = !"git ls -10 HEAD" - last = !"git ll -1 HEAD" + tail = !"git lg -10 HEAD" + last = log -1 HEAD type = cat-file -t dump = cat-file -p who = shortlog -s -- remotes = remote -v root = rev-parse --show-toplevel - -# go branch - go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" - # rebase branch - reb = "!r() { git rebase -i HEAD~$1; }; r" - # delete branch - dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" -#un = reset --hard HEAD -#uh = reset --hard HEAD^ - uncommit = reset --soft HEAD~1 - rmcommit = reset --hard HEAD~1 - unstage = reset HEAD -- - discard = checkout -- cl = clone --recursive # Show the diff between the latest commit and the current state @@ -78,19 +70,19 @@ grep = auto [github] user = jannikz -[branch "master"] - rebase = true +[help] + autocorrect = 10 [branch] autosetupmerge = always autosetuprebase = always -[help] - autocorrect = 10 +[branch "master"] + rebase = true +[rebase] + autostash = true [pull] rebase = true [push] default = tracking -[rebase] - autosquash = true [apply] whitespace = fix [include]