Last active
July 29, 2021 20:36
-
-
Save JoshuaSoileau/3a7f069c055ed21ca7590770aaf32ea0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
branches = "!f(){ git reflog | egrep -io \"moving from ([^[:space:]]+)\" | awk '{ print $3 }' | awk ' !x[$0]++' | egrep -v '^[a-f0-9]{40}$' | head; }; f" | |
copy = "!f(){ git rev-parse --abbrev-ref HEAD | tr -d '\n' | pbcopy; }; f" | |
delete-merged = "!f(){ git fetch --all; git checkout origin/develop; git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d; }; f" | |
forgot = commit -a --amend -C HEAD | |
history = for-each-ref --sort=-committerdate refs/heads/ --count=20 --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))' | |
last = log -1 HEAD | |
load = "!f(){ git checkout $1; git reset --soft HEAD~; git unstage .; }; f" | |
merge-last = "!f() { last_branch=$(git rev-parse --abbrev-ref @{-1} | tr -d '\n'); echo $last_branch; git merge --no-ff $last_branch; }; f" | |
rank = shortlog -sn --no-merges | |
pr = "!f(){ repo=\"$(git remote show origin -n | grep h.URL | sed 's/.*://;s/.git$//')\"; base=${1:-develop}; branch=\"$(git symbolic-ref --short HEAD)\"; open 'https://github.com/'$repo'/compare/'$base'...'$branch'?expand=1'; }; f" | |
revive = "!f() { hash=$(git rev-list -n 1 HEAD -- $1); git checkout $hash~1 -- $1; }; f" | |
save = !git add -A && git commit -m 'INVISIBLE SAVE' && git reset --soft HEAD~1 && git reset HEAD -- . | |
task = "!f(){ task=$(git branch | grep $1); git checkout $task; }; f" | |
wipe = !git save && git checkout . | |
unstage = reset HEAD -- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment