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

Asked

Viewed 636 times

1

I have the arm develop in my local machine. In develop remote there are about 10 programmers pushing every day.

That’s why I always pull before merging my develop with the feature123 I’m working on and about to send to the remote feature123 arm.

Doing the remote develop pull I got 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 that 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 ( that was last night ). I didn’t work on the develop.

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

The second thing I don’t understand is why it was considered Both modified: postback.php modified on both sides if I didn’t work with him on the local develop. I have another arm called feature123 and on this arm I modified the postback.php file. But it wasn’t in develop.

Can anyone explain why git showed this message?

  • You’re not in the branch feature123 and trying to do pull of develop?

  • no, I’m in the develop branch

  • And the file postback.php that you modified was committed? Note that I did not say sent to the server, I want to know if it was committed locally.

  • This happened a few times, I could not figure out the reason to solve in a 'correct' way, but as I always leave synchronized, I decided to delete the (os) local file(s) that appeared(m) as modified(s) (even without modifying), pull, then commit, and then push would work again, but turn and move it happens, and sometimes it doesn’t work, in these cases I need to clone again, will be very useful an answer, because this must be problem by misuse.

  • LINQ, postback.php has been modified and committed in my feature123 branch. I’m now in the develop branch. No reason to have modification or commit here.

  • @Anthraxisbr is.. I have to understand where this misuse is coming from.. Whether on my part, or the software I’m using or some other bug somewhere else.

Show 1 more comment

1 answer

1


There are some probabilities I will quote in order of relevance:

  1. Someone’s done the wrong merge between the branchs
  2. Your local branch is called feature123 but is pointing to develop
  3. The checkout-site.php file was changed commited and git couldn’t understand the changes by itself (simple as that, it might happen);

Solutions:

  1. I want my develop to look the same as it is in the repository:

git fetch all

git reset --hard origin/develop

git pull

  1. I didn’t change the checkout-site.php file I only want it to look 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:

  • Enter the file and look for the merge changes that git automatically created as an example 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 per the git merge documentation
  • You must commit the changes and go up the server

    git commit -m "Merge of changes"

    git push

  • This last option happens to me direct, including the Netbeans error alert code because of this, option 2 solved my problem.

  • @Anthraxisbr because it happens to me sometimes too , rs

  • @Diogo, after analyzing here I think it is the second case. As I see which branch my site is pointing to?

  • @zwitterion git branch -vv

Browser other questions tagged

You are not signed in. Login or sign up in order to post.