Skip to content

Instantly share code, notes, and snippets.

@agborkowski
Created June 18, 2012 13:21
Show Gist options
  • Save agborkowski/2948341 to your computer and use it in GitHub Desktop.
Save agborkowski/2948341 to your computer and use it in GitHub Desktop.
bash:profile:command: github push active branch to github, make new feature
# GitHub make new feature
ghf(){
git checkout master
git fetch github
git merge --ff github/master
git checkout -b $1 master
git push -u github $1
echo 'done'
}
# GitHub push new feature to github
ghp(){
git fetch master
git merge --ff master/$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
git pull github $(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
git push github $(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
echo 'done'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment