Subject: Re: config for merging master to test branch

From: Junio C Hamano <[email-masked]>
Date: Tue, 29 Dec 2009 08:53:41 -0800

Daniel Convissor <[email-masked]> writes:

> On Mon, Dec 28, 2009 at 06:38:39PM -0500, Daniel Convissor wrote:
>> 
>> Now, here's the question.  I want to go back into the testing directory 
>> and do a "git pull" and have the changes from master automatically merged 
>> into my test branch in one step, without having to do an explicit set of 
>> checkouts and merges.
>
> I found this is possible by being in the "test" checkout and calling
> "git pull origin master".  Is this the best way to do it?

Good.  That is how it was designed to be used ;-)

If you feel lazy and want to omit typing " origin master", you could add a
few configuration items in your .git/config in the test repository.

    [branch "test"]
        remote = origin
        merge = refs/heads/master

That configures git in such a way that...

    When on branch "test", "pull" and "fetch" by default interact with the
    "origin" repository, and "pull" integrates what was found on the
    'master' branch from that remote into your history.