- Set up the main branch warehouse address first
2. Clone the main branch code to the local PC3. Right-click to create a branch repository
The first step:The second step:4. After the development is completed in the local branch, merge the development into the main branch
Step 1: commit your local branch code to your branch remote repositoryStep 2: Switch to the main branch, which focuses on how to solve the conflicts when cutting branches and merging. It is not a flat road, and there will definitely be conflicts in multi-person development.
Cutting to the main branch is like pulling the latest code, there is no need to update it again, you can also update it again. Step 3: Merge your own branch code when you switch back to the main branch.
Normally, it is directly selected to edit conflict, and then do conflict processing, may be my version of the problem, can not be edited in the conflict to merge, so I choose to resolve all later. When you don’t know how to merge, choose to solve later
After closing the window, you will see the following image. Double-click the conflict file to edit it
Then select the part you want to merge
Save and you will be prompted to see if it is resolved. Select mark as resolved
Save the refresh and close the window without collisions
And I’m gonna hit OK
And then commit, and that commit is what you’re going to commit to the main branch.
Submitted successfully
Submitted here is your main branch merge code, your branch has not been merge.
Then cut back to its own branch and select merge the main branch operation again. So the first time you cut to the main branch you merge the branch code, you commit it to the main branch, you cut back to your branch, you merge the main branch code again, and then you can develop directly.