Reputation: 993
I have a problem with my SourceTree repository. I don't know what I did but now I have 1 branch behind and 1 branch ahead. And if I try to pull I get error which is saying that I have uncommitted changes (but I dont have any) and if I try to push I get error and is saying that I need to pull first. If I try to merge my branch I also get error which is saying: "fatal: You have not concluded your merge (MERGE_HEAD exists).Please, commit your changes before you merge."
Here is a picture:
And here is a video: http://recordit.co/MYOgeSFTaD
Thank you for your time !
Upvotes: 4
Views: 5256
Reputation: 2500
Came across the same issue, the solution that I went for and worked fine is:
1 - Stashed changes for remaining on the safe side
2 - Took backup for remaining at the safer zone :)
3 - Then discarded all the changes showing up in the commit area -> Top left button in the source tree.
4 - Pull and merge changes first. Then push your changes. Everything will be aligned.
Upvotes: 0
Reputation: 993
I fixed by pressing the Commit button and after I checked "Push changes immediately to origin" and effectively I commit nothing (0 files). But there was created a connection between the branch and master and now I don't have anymore errors. I don't know if is normal or not but this fixed my problem. Here is a photo so you can compare the first photo with this one:
Thanks !
Upvotes: 1
Reputation: 2591
Your distant origin/master
and your local master
are both 1 commit ahead.
1 behind means the distant repo is 1 commit further from your common base
1 ahead means your local workspace is 1 commit further from your common base
If you want to push your modifications you have to catch up distant commits (1 behind) and merge it with your local modifications (1 ahead). Press Pull, if there's no conflict (your edits aren't located at the same place as theirs) it creates a new commit for you, else you'll have to solve those conflicts first.
You'll then be 2 ahead but no longer behind. You can't push with commits behind. Just push your modifications.
I edit this after watching your video. There's conflicts in your workspace. Just click on File Status on the left side bar and solve these conflicts. Then commit, then push, as explained above.
Upvotes: 2