How to merge from a second remote?
Asked by Huevos:

How to merge from a second remote?

I've got two remotes. One is identical to my local and the other is slightly different (from a different project). How do I cherry-pick commits from the second remote and merge them into my project. So far I have trashed my local about 20 times trying to do this.

Also if there is a conflict how do I solve it?


Answers:
author: Huevos
body: Here's what it looks like without the cherry pick window. So where is the minimised window?

UNTITLED.jpg  
[](https://community.atlassian.com/t5/Sourcetree-questions/How-to-merge-from-a-second-remote/qaq-p/245201?attachment-id=9027){#link_116b1114e021d7}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/7208/1/UNTITLED.jpg){#display_116b1114e021d7_0}

comments: author: Bal?zs Szakm?ry
body: It is the grey bar in the middle that says File Status, Branches, Remotes. Your current branch is master.


author: Huevos
body: How do I select the target branch. Maybe I am cherry picking back to the same branch.

Anyway thanks for the help so far.

comments: author: Bal?zs Szakm?ry
body: In your screenshot above there is a part of the window that you minimised to non-existence. It should be between the bookmarks and the history part. Make it appear.Here you will see the local branches and the remote branches. The one which is bold is the current branch. You can switch to another by double-clicking the branch name.


author: Huevos
body: Still not getting anywhere fast with cherry pick. Now I get this.

cherry-pick.jpg  
[](https://community.atlassian.com/t5/Sourcetree-questions/How-to-merge-from-a-second-remote/qaq-p/245201?attachment-id=2621){#link_116b112be95414}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/7204/1/cherry-pick.jpg){#display_116b112be95414_0}

comments: author: Bal?zs Szakm?ry
body: "Nothing to commit" =\> Looks like the change you were trying to cherry pick is already included in the target branch


author: Huevos
body: Ok, I've got both remotes loaded. I fetch from remote one (copy of origin) and it says 5 commits behind. In the Log/history at the top it says "uncommitted changes". How do I commit those changes? Because while they are there I can't do anything. Tried the commit button but it doesn't commit them.

comments: author: Bal?zs Szakm?ry
body: Try refreshing the view (F5) in the commit dialog. It has to show all uncommitted changes after this. You can select them to be committed or discard them as you see fit.


author: Huevos
body: Any particular program you recommend for doing the merges?

comments: author: Bal?zs Szakm?ry
body: I like <http://kdiff3.sourceforge.net/> , it is simple, fast and free. (In SourceTree, go to Tools\\Options\\Diff to set up the integration.)


author: Bal?zs Szakm?ry
body: Cherry pick:

1. check out the branch you want to cherry pick to
2. right click on the commit you want to cherry pick and select cherry pick

diff program: a [file comparison tool](http://en.wikipedia.org/wiki/File_comparison) that can do merges. (You will need something that can do 3-way merge.)


author: Huevos
body: Thanks for the answer. Had no problem already with steps 1,2,\& 3.

Please explain step 4 (cherry pick) as I can't figure out how to do this.

Also, when you say a diff program what do you mean? Up until now I've always edited my code in a text editor (Crimson).


author: Bal?zs Szakm?ry
body: \[Assuming your clone has both remotes connected. If not, right click on "Remotes" and add the second one.\]

Just above the top-left corner of the commit list, there is a drop-down (All Branches / Current Branch) and a checkbox (Show Remote Branches). Set these to All branches and on.

Do a Fetch, make sure the Fetch from all remotes option is on.

Now you should see the remote branches from both repos and you can cherry-pick merge from any of them.

For resolving conflicts, you need to have a diff program and set it up in Tools/options.


author: Huevos
body: So, is this not possible in Sourcetree then? If not what is the point of multiple remotes?