How to Develop on Separate Branches
Start
checkout new branch
pull request the code from this branch
Now you can develop as usual.
Tips
When master has an update and needs to sync the update to the local feature branch
- First you need to switch to the master branch locally (git checkout master)
Switching branches is shown in the following picture:- Then pull code from master (git pull)
- Switch back to your own branch (git checkout feature)
- Do a merge (git merge)
- Resolve conflicts if there are any
- add and commit file after resolving the conflict locally as usual
- 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.