Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] How to merge (programmatically) with a remote repo?

2011/10/10 André Dietisheim <adietish@xxxxxxxxxx>
On 10/10/2011 05:19 PM, Matthias Sohn wrote:

merge is a local operation so you first need to fetch the commits you want to merge
in order to make them available to the merge operation in the local object database


great, thanks!
So I would first have to clone a branch on the remote repo locally and then merge among those branches, right?
 
Clone does not transport a branch but creates a copy of the remote
repository. In order to transfer new branches and/or commits
incrementally when you already have a clone you need to run a
fetch command.

Instead of starting from scratch by initializing a standalone repository
and then configuring a remote pointing to the remote repository you may 
instead clone the remote repository. This will already configure a remote for the
remote repository you are cloning from, by default this is named "origin".
Then, if you want to transport new commits or newly created branches
from the remote repository to your local clone you need to run a fetch
command. Then run merge command in order to merge the new commits 
into some local branch. You may also use pull which combines these two steps
(fetch + merge) into one command.

--
Matthias

Back to the top