Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to merge from a second remote?

Huevos September 18, 2014

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?

9 answers

0 votes
Huevos September 26, 2014

Here's what it looks like without the cherry pick window. So where is the minimised window?

UNTITLED.jpg

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2014

It is the grey bar in the middle that says File Status, Branches, Remotes. Your current branch is master.

0 votes
Huevos September 25, 2014

How do I select the target branch. Maybe I am cherry picking back to the same branch.

 

Anyway thanks for the help so far.

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2014

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.

0 votes
Huevos September 24, 2014

Still not getting anywhere fast with cherry pick. Now I get this.

 

cherry-pick.jpg

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2014

"Nothing to commit" => Looks like the change you were trying to cherry pick is already included in the target branch

0 votes
Huevos September 22, 2014

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.

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2014

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.

0 votes
Huevos September 21, 2014

Any particular program you recommend for doing the merges?

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 21, 2014

I like http://kdiff3.sourceforge.net/ , it is simple, fast and free. (In SourceTree, go to Tools\Options\Diff to set up the integration.)

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 21, 2014

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 that can do merges. (You will need something that can do 3-way merge.)

0 votes
Huevos September 21, 2014

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).

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 21, 2014

[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.

0 votes
Huevos September 21, 2014

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events