diff --git a/includes/bash_functions.bash b/includes/bash_functions.bash index 5db1e63..d02173e 100644 --- a/includes/bash_functions.bash +++ b/includes/bash_functions.bash @@ -147,6 +147,28 @@ function git-bitbucket() { git push -u origin master } +# Add remote upsteam +# USAGE: git-fork +function git-fork() { + user=$1 + if [[ "$user" == "" ]] + then + echo "Usage: git-fork " + else + repo=`basename "$(pwd)"` + git remote add upstream "https://github.com/$user/$repo.git" + fi +} + +# Sync branch with upstream +# USAGE: git-upstream [branch] +function git-upstream() { + branch=${1-master} + git fetch upstream + git co origin $branch + git merge upstream/$branch +} + # Install/update all NPM tasks used in grunt.js in current folder function npm-grunt() { if [ ! -f "grunt.js" ]; then