git tutorial Learning (v)

Source: Internet
Author: User

14. Conflict resolution

14.1. Scene

Conflicts occur when both branch A and branch B have modifications on the same file. The common scenario is that the new branch Dev is generated from the master branch and then modified and add&commit on the dev. The same file was later modified on master, and the add &commit, the operation of merging two branches will fail.

$ git merge feature1auto- in then commit the result.

14.2. Conflict resolution

Here git merges the conflict into the file and must resolve the conflict manually before committing.

 Free software distributed under the GPL. Git has a mutable index called stage. Git tracks changes of files. <<<<<<<& Simple . =======Creating A new branch is quick and simple. >>>>>>> Feature1

<<<<<<<,=======,>>>>>>> The contents of the conflicting two files are separated. The problem can only be resolved by changing the contents of one branch to another. It's usually about changing the master branch to Dev, because you're going to merge the new dev content into master.

Then you can merge them.

15. Branch Management Policy (FF mode issues)

After a branch merge in Fast forward mode, there is no record in the history because it cannot be counted as a single commit. Merging with the '--no-ff ' can be combined with the normal mode, the merged history has branches, you can see the merging operation.

The general project should have the master and dev branches, as well as the branches of the individual developers. The Master branch is the most stable branch. The new release is posted on this, and the Dev branch is the development branch, and the individual development results are consolidated on Dev, all of which are then merged into master

git tutorial Learning (v)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.