[Git branch operation---Explanation 2]

View branches

Insert image description here

Create a branch

Insert image description here

switch branch

Insert image description here

Modify branch

Insert image description here

switch branch

Insert image description here

merge branches

Insert image description here
Insert image description here

Merge branches [conflict] (only the main branch will be modified and no other branches will be modified)

When will there be conflict?

The two branches have two different writing methods for the same file and the same location, or there may be conflicts when modifying.
First modify hello.txt on the master branch [My modification is to add the second to last line Go to jjjjjjjjjjj]
Insert image description here
Add gggggggg to the penultimate line
, then switch back to the master branch, and then merge. At this time, conflicts will occur.
At this time, we will vim hello.txt
and then you can see where the conflicts occur. Then we manually modify the conflict,
save it after the change
, and then add it to the temporary storage area git add hello.txt
to submit the local library git commit -m "Merge conflict"
Insert image description here
Insert image description here

Insert image description here

おすすめ

転載: blog.csdn.net/Clover_zlx/article/details/132422321