Skip to content

Instantly share code, notes, and snippets.

@scottrobertson
Created July 29, 2013 09:08
Show Gist options
  • Save scottrobertson/6103128 to your computer and use it in GitHub Desktop.
Save scottrobertson/6103128 to your computer and use it in GitHub Desktop.
Github Flow
# 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