Skip to content

Instantly share code, notes, and snippets.

@dulichan
Created January 23, 2014 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dulichan/8583865 to your computer and use it in GitHub Desktop.
Save dulichan/8583865 to your computer and use it in GitHub Desktop.
Git repo management scripts
# Merge development branch to master branch
function merge_projects(){
# Path to child project
cd /Users/dulitharasangawijewantha/Development/WSO2/apps/mdm
git checkout master
git pull origin master
git merge $1
git push origin master
}
# Get updates from master for child projects in parent project
function merge_submodule(){
# Child project location in parent project
cd /Users/dulitharasangawijewantha/Development/WSO2/wso2mobile-server/products/mdm/modules/jaggery-apps/mdm
git pull origin $1
}
# Push all child projects to development branch
function pull_all_projects(){
# Path to child project
cd /Users/dulitharasangawijewantha/Development/WSO2/apps/mdm
git pull origin $1
}
# Push code from current branch to remote branch
function push_all_projects(){
# Path to child project
cd /Users/dulitharasangawijewantha/Development/WSO2/apps/mdm
git push origin $1
}
# Get the new development branch from github
function get_new_dev_branch(){
# Path to child project
cd /Users/dulitharasangawijewantha/Development/WSO2/apps/mdm
git fetch origin
git checkout remotes/origin/$1
git checkout -b $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment