Last active
April 28, 2017 04:35
-
-
Save christianacca/4d31bb0f1126a352a3c2 to your computer and use it in GitHub Desktop.
GIT aliases for keeping history clean
This file contains 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] | |
ec = config --global -e | |
co = checkout | |
cob = checkout -b | |
pushit = "!f() { git rev-parse --abbrev-ref HEAD ; }; git push --set-upstream origin `f`" | |
up = !git pull --rebase --prune $@ && git submodule update --init --recursive | |
startb = "!f() { git cob $1 && git pushit; }; f" | |
syncb = !git fetch origin ${1-master} && git rebase origin/${1-master} | |
cleanb = !git rebase -i origin/${1-master} | |
finishb = "!f() { git rev-parse --abbrev-ref HEAD | xargs -i_branch sh -c 'git checkout ${1-master} -f && git pull origin && git merge _branch --ff-only && git push origin ${1-master}'; }; f" | |
deleteb = "!f() { git branch -d $1 && git push origin --delete $1;}; f" | |
fdeleteb = "!f() { git branch -D $1 && git push origin --delete -f $1;}; f" | |
cml = !git add -A && git commit -m | |
cm = "!f() { git cml \"$@\" && git push origin;}; f" | |
save = !git add -A && git commit -m 'SAVEPOINT' | |
wip = !git add -u && git commit -m "WIP" | |
ammend = !git add -A && git commit --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" | |
new = "!f() { git log $1@{1}..$1@{0} \"$@\" ;}; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment