M
M
MaxEpt2015-08-01 14:10:22
git
MaxEpt, 2015-08-01 14:10:22

Merge branches in git, why is there no conflict?

Good afternoon! learning to use git. The question arose, in the master branch I write on the first line of the file 123.
I create a new test branch, switch to edit the first line to 456
Commit, switch to the master - there is 123 in the file, everything seems to be as it should. I do a git merge test and the system replaces the first line with 456, why is there no conflict?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-08-01
@MaxEpt

because the test branch was created on the basis of the commit where this line already existed, and when the merge took place, there were no later commits affecting this line. And that means no conflicts.
If you want to get a conflict - after you commit the changes in the test branch, return to master, correct the same line, commit and then try to merge.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question