From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: git pull and merging.
Date: Wed, 06 Dec 2006 10:31:29 +0100 [thread overview]
Message-ID: <el62hi$esu$1@sea.gmane.org> (raw)
In-Reply-To: cc723f590612052121u1f6e3c9lc7329f40ee1c9e5a@mail.gmail.com
Aneesh Kumar wrote:
> On 12/6/06, Junio C Hamano <junkio@cox.net> wrote:
>> "Aneesh Kumar" <aneesh.kumar@gmail.com> writes:
>>
>>> I have a git.git clone using --use-separate-remote. That means i have
>>> the master branch created by default. Now i need to build git from the
>>> pu branch too. So i created git branch pu remotes/origin/pu.
>>>
>>>
>>> How how do i track the pu branch using git pull. What i mean is the
>>> master local branch is tracked by default using git pull. Is there a
>>> way to track the local pu branch too.
>>
>> $ cat>.git/remotes/origin <<\EOF
>> URL: ...kernel.org/pub/scm/git/git.git
>> Pull: refs/heads/master:refs/remotes/origin/master
>> Pull: refs/heads/next:refs/remotes/origin/next
>> Pull: +refs/heads/pu:refs/remotes/origin/pu
>> EOF
Or you can do .git/config equivalent:
$ git repo-config remote.origin.url ...kernel.org/pub/scm/git/git.git
$ git repo-config remote.origin.fetch refs/heads/master:refs/remotes/origin/master
$ git repo-config remote.origin.fetch refs/heads/next:refs/remotes/origin/next
$ git repo-config remote.origin.fetch +refs/heads/pu:refs/remotes/origin/pu
>> Then you would checkout 'pu' by having a matching local branch:
>>
>> $ git branch pu remotes/origin/pu
>> $ git checkout pu ;# this is your refs/heads/pu
>> $ make
>>
>> Hacking on it can be done in this branch as usual. When you are
>> interested in the latest 'pu' from me:
>>
>> $ git checkout pu ;# this is your refs/heads/pu
>> $ git fetch ;# most of the time git pull would also be fine...
>>
>> and then:
>>
>> $ git rebase remotes/origin/pu
>>
>> The 'rebase' in the last step is because my 'pu' rewinds freely;
>> otherwise you would do "git merge remotes/origin/pu" instead.
>>
>
> Okey what i was looking for was a .git/config that will imply as a
> part of git pull origin that local
>
> master is to track remotes/origin/master
> pu should track remotes/origin/pu.
>
> I almost felt the branch.<name>.merge was for that.
>
> What is this git-repo-config used for. I am trying to understand
>
> branch.<name>.remote and branch.<name>.merge usage.
Yes it is what branch.<name>.merge is for... and it would work for
any branch _except_ pu, which rewinds frequently, and you should
rebase your changes on top of current version instead of merging.
Still it is useful to add branch.<branch>.remote for pu:
$ git repo-config branch.refs/heads/pu.remote origin
so you can do just "git fetch" on pu to fetch from origin (well,
"git fetch" would fetch from origin as it is the default even in
absence of branch.<branch>.remote).
If it were any other branch, for example next, you could add
$ git repo-config branch.refs/heads/next.remote origin
$ git repo-config branch.refs/heads/next.merge refs/remotes/origin/next
for "git pull" on next branch fo fetch from origin and merge
next branch from origin.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
next prev parent reply other threads:[~2006-12-06 9:29 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-06 4:51 git pull and merging Aneesh Kumar
2006-12-06 5:02 ` Junio C Hamano
2006-12-06 5:21 ` Aneesh Kumar
2006-12-06 9:26 ` Johannes Schindelin
2006-12-06 10:00 ` Peter Baumann
2006-12-06 10:14 ` Johannes Schindelin
2006-12-06 10:23 ` Peter Baumann
2006-12-06 10:05 ` Aneesh Kumar
2006-12-06 10:28 ` Jakub Narebski
[not found] ` <cc723f590612060236k7839942el8d048eedfdee3682@mail.gmail.com>
[not found] ` <cc723f590612060248y6f730a54l3a2aadfa6500d36d@mail.gmail.com>
2006-12-06 10:48 ` Fwd: " Aneesh Kumar
2006-12-06 16:44 ` Josef Weidendorfer
2006-12-07 6:46 ` Aneesh Kumar K.V
2006-12-07 11:27 ` Josef Weidendorfer
2006-12-07 19:06 ` Junio C Hamano
2006-12-07 22:54 ` Josef Weidendorfer
2006-12-08 1:56 ` Santi Béjar
2006-12-08 17:23 ` Josef Weidendorfer
2006-12-08 19:12 ` [PATCH] Add branch.*.localmerge and documentation update Josef Weidendorfer
2006-12-08 20:52 ` Santi Béjar
2006-12-08 21:38 ` Junio C Hamano
2006-12-08 21:48 ` Jakub Narebski
2006-12-08 22:01 ` Josef Weidendorfer
2006-12-08 22:34 ` Junio C Hamano
2006-12-08 23:17 ` Josef Weidendorfer
2006-12-08 23:41 ` Junio C Hamano
2006-12-09 1:28 ` [PATCH] Add branch.*.merge warning " Josef Weidendorfer
2006-12-09 16:14 ` Santi Béjar
2006-12-08 21:39 ` [PATCH] Add branch.*.localmerge " Josef Weidendorfer
2006-12-08 22:15 ` Santi Béjar
2006-12-08 20:09 ` git pull and merging Santi Béjar
2006-12-08 7:07 ` Junio C Hamano
2006-12-07 23:06 ` Junio C Hamano
2006-12-08 2:04 ` Santi Béjar
2006-12-08 11:48 ` Jakub Narebski
2006-12-06 9:31 ` Jakub Narebski [this message]
2006-12-06 9:58 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='el62hi$esu$1@sea.gmane.org' \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).