Does anyone explain this message from git, after a pull to develop it?

1

I have the develop arm on my local machine. No develop remote there are 10 programmers pushing every day.

So I always do a pull before doing the merge of my develop with the feature123 that I'm working on and about to send to the remote feature123 arm.

Doing the pull of the remote develop had the following message:

$ git pull origin develop
Enter passphrase for key '/c/Users/.../.ssh/id_rsa':
remote: Counting objects: 193, done.
remote: Compressing objects: 100% (193/193), done.
remote: Total 193 (delta 149), reused 0 (delta 0)
Receiving objects: 100% (193/193), 30.63 KiB | 0 bytes/s, done.
Resolving deltas: 100% (149/149), completed with 48 local objects.
From bitbucket.org:.../....-source
 * branch                develop    -> FETCH_HEAD
   21......64........c8  develop    -> origin/develop
Auto-merging postback.php
CONFLICT (content): Merge conflict in postback.php
Auto-merging includes/db_manager.php
Auto-merging checkout-site.php
Automatic merge failed; fix conflicts and then commit the result.

That says there were some automatic merges and one that could not be done automatically in the case in the postback.php file.

Then I asked for a status:

$ git status
On branch develop
Your branch and 'origin/develop' have diverged,
and have 131 and 74 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
You have unmerged paths.
  (fix conflicts and run "git commit")
  (use "git merge --abort" to abort the merge)

Changes to be committed:
...
modified:   admin/details.php
...
both modified:   postback.php

The fact is that what I have in my develop is exactly what I had since the last pull (which was last night). I did not work in develop.

The first thing I do not understand is that it was not possible to merge automatically, since it was done in the other files and in none of them was there a change in the branch in question - in the case develop.

The second thing I do not understand is why it was considered both modified: postback.php modified on both sides if I did not work with it in the develop local. I have another arm that is called feature123 and in that arm I modified the postback.php file. But it was not in develop.

Can anyone explain why git showed this message?

    
asked by anonymous 18.08.2017 / 15:56

1 answer

1

There are some skills I will cite in order of relevance:

  • Someone has committed the wrong merge between the branches
  • Your local branch is called feature123 but it is pointing at develop
  • The checkout-site.php file has been changed commented and git could not understand the changes alone (simple as this may happen);
  • Solutions:

  • I want my develop to be the same as it is in the repository:
  •   

    git fetch all

         

    git reset --hard origin / develop

         

    git pull

  • I did not change the checkout-site.php file, I just want it to look just like the repository:
  •   

    git fetch all

         

    git checkout-site.php

         

    git pull

    3 I want to resolve the conflict after all, I want to understand what happened in the file:

    • Go to the file and look for the merge changes that git created automatically as shown below:

    <<<<<<< HEAD:index.html
    <div id="footer">contato : [email protected]</div>
    =======
    <div id="footer">
      por favor nos contate em [email protected]
    </div>
    >>>>>>> iss53:index.html
    • After locating the code make the changes, as a git merge documentation
    • You should commit the changes and upload them to the server

        

      git commit -m "Merge changes"

           

      git push

    18.08.2017 / 17:41