Help tips for errors
Asked by monkeypunch:

I'm using SourceTree for a project and it is driving crazy when I get an error. I don't know what to do. Could you consider putting a suggested fix type of thing for when this happens? Maybe a video or link to a tutorial based on the error.

For example, I'm getting this error:

![](../../upfiles/Screen_Shot_2014-06-10_at_5.16.57_AM.png)

I want to know what to do in SourceTree when this happens.


Answers:
author: Seth
body: There is a suggested fix. It is right there in red. You started a merge, but did not commit it, and now you are trying to pull.

Have you read the [Git book](http://git-scm.com/book)? I suggest sections 1.1, 1.3, and chapters 2 and 3. Once you have a better understanding of what Git is doing, the error messages will make more sense and you will have a better idea of what to expect when you hit any button in SourceTree.

comments: author: monkeypunch
body: I have to use git for work. I've read that before. Some of the error messages are much less descriptive. Also, the process for merging is multistep. The error messages don't always cover how to resolve it IMHO. Also, I edited my feelings from the post. That doesn't need to be there I think.


author: Seth
body: Thanks, I'll edit mine as well.

There is a very good reason that error messages don't tell you how to resolve merges - they don't know. Usually what happens when there is a conflict is that the same line of code has been changed on two different branches in two different ways. The software cannot know which is right (or if there is a way to do both together), it takes a programmer to read the code and resolve the conflict.

Also, when you say error messages are "less descriptive", what are you comparing to? I've used a few other version control systems (CVS, SVN), and generally find Git's messages to be as or more descriptive.


author: Seth
body: Also, what tool do you use for merging? I'd try to find a merge tool that makes the process more transparent (even if you have to pay for it), and configure SourceTree to use that.

Make sure the tool supports 3-way merge (WinMerge, for example, does not. It only shows a 2-way diff). A 3-way merge shows you 3 versions of your file 1) before the branches split 2) your branch 3) the branch you are merging. You might try [Meld](http://meldmerge.org/).


author: monkeypunch
body: In the case of the merge, it says you can merge the conflicts by selecting the files and using the options under the resolve conflicts menu. I would keep that instructions going.

1. Select the files that are conflicted. These files will have an \[!\] icon next to them in the staged files(?) view. When a merge conflict occurs a copy of your file and the remote file are created for you to compare (are there more?).

2. Right click and select "Resolve Conflicts" and choose one of the appropriate options. You can merge files using an merge tool, use your copy or use their copy.

3. If you launch an external merge tool then you must apply the changes to the original file. Examples here.

4. Once the original file is updated select "Mark Resolved" from the "Resolve Conflicts" menu. This will remove the merge conflicts files and remove the merge conflict icon next to the file.

5. You are now ready to continue what you were doing. Treat yourself to a sundae or something.

6. If something goes wrong don't worry. You can revert to right before the pull by selecting the version you were at and click Reset and choosing hard reset.

Something like that. Feel free to use this. I don't know if it's right. I would add pictures, or maybe make it into a video. But this is what I would help me get through these times.


author: monkeypunch
body: I'm comparing it to what I would like to see. CVS and SVN were less helpful than git. I'll post the messages next time.

Merge conflicts are a pain for me. With the tool that's opened on Mac it doesn't have any instructions. I'll try to add a screenshot next time it happens.

When I commit and then do a pull and it tells me there are merge conflicts I don't know what to do. Right at this point I need help. There was a pop up that pointed me in the right direction. This is exactly what I need. But there were 5 more steps that I could have used help with.

![](../../upfiles/Screen_Shot_2014-06-10_at_5.00.19_AM.png)

You have to remember this is the worst time for something to go wrong for a programmer. Your version control is helping you backup and save your work so you can revert if anything goes wrong. It gives you peace of mind. But if your backup isn't working and it's possible you just screwed up and may lose all your changes and all that work for the last day week or whatever is lost people will flip out. It's not a good time for things to go wrong. It's a little like an operation. As you can tell, I took a screen shot.


author: monkeypunch
body: BTW I don't think the redo works in this editor.

Steps to reproduce:

1. type something

2. command + z to undo it

3. use command + shift + z to redo it

Result:

the redo button is grayed out but nothing is restored.

Using Mac OSX Firefox


author: monkeypunch
body: When I did Launch Merge Tool a tool came up I think called File Merge. I have never seen it before. It showed two files and arrows pointing to the left or right down the middle. It had one drop down list at the bottom of the screen that said Action. There was no other buttons anywhere.

I guess it comes with XCode. Here's a screenshot I found online:

![](../../upfiles/FileMerge-file-comparison-mac_1.png)


author: Seth
body: Yeah, that's a 2-way merge, not a 3-way merge.

Also, open a feature request on [jira.atlassian.com](http://jira.atlassian.com)for the extended instructions, and post the link here as a new answer.