Hi ,

 

I am getting error with git while pulling. Here are the steps I have followed.

  1. Pull latest code.
  2. Merge my changes and commit.
  3. Before I push, somebody made push in GIT.
  4. I am trying to push and it says you need to pull first with latest copy.
  5. I tried to pull and it gives error again.
  6. I reverted my commit.
  7. But I need to push reverse to GIT and it does not allow and get below error:-

     = [up to date]      post_patch2_merge -> post_patch2_merge

     ! [rejected]        Release2.2 -> Release2.2 (non-fast-forward)

    error: failed to push some refs to 'w028@git.com.au:/app/git-repos/salesforce/newco.git'

    hint: Updates were rejected because the tip of your current branch is behind

    hint: its remote counterpart. Integrate the remote changes (e.g.

    hint: 'git pull ...') before pushing again.

    hint: See the 'Note about fast-forwards' in 'git push --help' for details.

    Completed with errors, see above

  8. Trying to pull  and get below erro:-
  9. git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin 

     

     

    git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree pull --no-commit origin Release2.2 

    You have not concluded your merge (MERGE_HEAD exists).

    Please, commit your changes before you can merge.

    Completed with errors, see above

Can you help please?

 

2 answers

1 accepted

I think the problem is your pull failed to merge automatically and went to conflict state. And the conflict wasn't resolved properly before the next pull.

1) Undo the merge and pull again.

To undo a merge:

git merge --abort 

2) Resolve the conflict.

3) Don't forget to add and commit the merge.

4) git pull now should work fine.

good luck!

 

SreeKumar, 

 

Can you please confirm if I need to do below step by UI

 

image2015-5-11 12:44:21.png

 

Thanks for your response. I am on Mac and not using command line. How I can do using UI.

You should only do that if you've resolved all conflicts.

Was this "resolved" ? You can resolve merge conflict in SourceTree UI too , using external tools .

It looks like your actual question has been pretty well addressed, but your life will be easier if you and the other developers work on separate feature branches.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

274 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot