Created
July 29, 2013 09:08
-
-
Save scottrobertson/6103128 to your computer and use it in GitHub Desktop.
Github Flow
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
# Git | |
alias git status='nocorrect git status' | |
alias master='git checkout master' | |
alias pull='git pull' | |
alias push='git push' | |
function feature { | |
EXISTS=$(git branch | grep feature/$1) | |
if [ "$EXISTS" != "" ]; then | |
git checkout feature/$1 | |
else | |
git fetch -p origin; | |
REMOTE_EXISTS=$(git branch | grep feature/$1) | |
if [ "$REMOTE_EXISTS" != "" ]; then | |
git checkout feature/$1 | |
else | |
git checkout -b feature/$1 | |
fi | |
fi | |
} | |
function features { | |
git branch --list | grep feature/ | |
} | |
function feature-sync { | |
git fetch origin && | |
git checkout feature/$1 && | |
git push origin feature/$1; | |
} | |
function feature-merge { | |
git fetch origin && | |
git checkout feature/$1 && | |
git pull origin feature/$1 && | |
git checkout master && | |
git pull origin master && | |
git merge feature/$1 && | |
git branch -d feature/$1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment