After you create a new branch, commit, or switch back to the master branch again Commit;git cannot be quickly merged at this time.
Can git status find conflicting files Readme.txt, view and modify, and then submit again
1. Create new branch Feature1, add Readme.txt content, then add and commit
Git checkout-b feature1
Modify the last line of Readme.txt to read:
Creating a new branch is quick and simple.
git add readme.txt
Git commit-m "and simple"
2. Switch back to the Master branch, add the Readme.txt content, then add and commit
git checkout Master
Modify the last line of Readme.txt to read:
Creating a new branch is quick & simple.
git add readme.txt
Git commit-m "& Simple"
3. Merge Error
git merge Feature1
Conflict
git status can also tell us about conflicting files
4. Modifications
View Readme.txt
Git is a distributed version control system.
Git is free software distributed under the GPL.
Git has a mutable index called stage.
Git tracks changes of files.
<<<<<<< HEAD
Creating a new branch is quick & simple.
=======
Creating a new branch is quick and simple.
>>>>>>> Feature1
git uses <<<<<<<,=======,>>>>>>> to mark different branches of content ,
We modify the following after saving:
Creating a new branch is quick and simple.
5. Submit
git add readme.txt
Git commit-m "Conflict fixed"
6. Use the git log--graph command to see the branch merge diagram
You can also see the merging of branches with the git log with parameters:
git log--graph--pretty=oneline--abbrev-commit
7. Delete Feature1 Branch
To delete a feature1 branch:
Git branch-d feature1
2016/01/13 Start learning git: Branch management: Resolving conflicts