I
I
Integior2015-01-03 14:16:54
git
Integior, 2015-01-03 14:16:54

How in GIT to resolve the conflict in the same lines so that changes from different branches go one after another?

I do not understand how to resolve the conflict in this case.
I have a develop branch with an index.html file:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  
</body>
</html>

I create a feature1 branch based on develop, in which I change index.html:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>

<div class="feature1">
    <div class="feauture1-content"></div>
    <div class="feauture1-content"></div>
    <div class="feauture1-content"></div>
    <div class="feauture1-content"></div>
  
</body>
</html>

Then I create a feature2 branch based on develop, add to index.html:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>

  <div class="feature2">
    <div class="feature2 another content"></div>
    <div class="feature2 another content"></div>
    <div class="feature2 another content"></div>
    <div class="feature2 another content"></div>
    <div class="feature2 another content"></div>
    <div class="feature2 another content"></div>
  </div>

</body>
</html>

I merge the contents of the feature1 branch into develop.
After I try to merge the contents of the feature2 branch into develop, I get the following conflict:
1c87df3f279e44029a5b9c715975c721.png
Actually, it is impossible to make changes from feature2 come after changes from the feature1 branch merged into develop.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Shumkin, 2015-01-03
@Integior

This is not a Git issue. This is a problem of either the editor with which you resolve the conflict, or the curvature of the hands. The easiest way: edit in your favorite IDE, and business.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question