Practical Web Programming

Tuesday, March 25, 2014

Git: Merge Develop Branch to Master

Normally when developing, you would make your changes in develop branch and when releasing, merge develop to master branch. Here's the best way to do it:

$ git checkout master                 # make sure you are in master branch
$ git fetch                                  # download commit from remote branch
$ git reset --hard origin/master     # removes changes/commits in local master branch (if any)
$ git merge origin/develop           # merge remote develop to master (the current branch)
$ git push origin master              # push the changes to remote repo

0 comments:

Recent Post