How to Develop on Separate Branches

Start

checkout new branch

new_branch.jpg



pull request the code from this branch

pull_request.png



Now you can develop as usual.



Tips

When master has an update and needs to sync the update to the local feature branch

  1. First you need to switch to the master branch locally (git checkout master)
    Switching branches is shown in the following picture:
    checkout_master.png
  2. Then pull code from master (git pull)
  3. Switch back to your own branch (git checkout feature)
  4. Do a merge (git merge)
    merge.png
  5. Resolve conflicts if there are any
  6. add and commit file after resolving the conflict locally as usual
  7. Then push the changes to the feature branch as usual


When need to fix the code on master

  • Just switch back to master(git checkout master) and make the changes. (After checkout, your code will be changed to the code on master.)
  • And after the changes, just push it to master normally.