Stick these two aliases in your .gitconfig to ease cleaning and updating your dev branches!
r = "!git remote prune origin; git clean -f -d; git checkout -- .; git pull"
update = "!f() { if [ $# -eq 0 ]; then bra=`git rev-parse --abbrev-ref HEAD`; else bra=$1; fi; st=`git stash -u | grep -o -e 'No local changes to save'`; git checkout master &> /dev/null; echo 'Switched to master.'; git r; git checkout ${bra} &> /dev/null; echo \"Back on ${bra}, beginning merge...\"; git merge origin/master &> /dev/null; git status; if [ \"\" == \"${st}\" ]; then echo 'Some files were stashed, use \"git stash apply\" to retrieve them.'; fi; }; f"
Written by Dan Bennett
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Alias
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#