Re: Git rescue mission

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> In order to prevent merging their 'master' into your 'topic'
> when you are on 'topic', git-fetch/git-pull from 1.5.0 uses
> further safety which is left by 'git clone'.  The real
> configuration created by 'git clone' looks like this:
>
> 	[remote "origin"]
>         	url = /repos/git/project
>                 fetch = refs/heads/*:refs/remotes/origin/*
> 	[branch "master"]
>         	remote = origin
>                 merge = refs/heads/master
>
> The 'fetch' lines correspond to 'Pull' in .git/remotes/origin file;
> it uses globbing pattern so if there are new branches on the
> remote side you can automatically track them, which is a plus.
>
> But more importantly, when 'fetch' lines only do the globbing
> pattern, 'git pull' without explicitly saying which remote
> branch you want to merge to the current branch (perhaps by
> mistake) refuses to do a merge, if there is no branch.*.merge
> configuration ("refs/heads/master" in the above example).  So
> with the above configuration, 'git pull' from 1.5.0 will fetch
> two remote branches and keep them in remotes/origin/master and
> remotes/origin/topic, and if you are on 'master' their
> refs/heads/master is merged into your current branch, but if you
> are on 'topic', it will not do the merge step (this only applies
> to "git pull" without any refspec parameters).
>
> With 1.4.4 series, I think you can create the [branch] section
> yourself and do something like this:
>
> 	[remote "origin"]
>         	url = /repos/git/project
>                 fetch = refs/heads/master:refs/remotes/origin/master
>                 fetch = refs/heads/topic:refs/remotes/origin/topic
> 	[branch "master"]
>         	remote = origin
>                 merge = refs/heads/master
> 	[branch "topic"]
>         	remote = origin
>                 merge = refs/heads/topic
>
> This configuration also works with 1.5.0, so if you are happy
> with this (I am assuming you are using 1.4.4 series, preferably
> the last one, 1.4.4.4), after you upgrade to 1.5.0, it will
> continue to do its thing (but you would want to upgrade the
> fetch line).

I think this should go to git-pull/git-clone man pages. Personaly for me this 
post dispels dark magic about git-pull's merging logic. I always did 
git-fetch and then git-pull . <some-branch> to control what and where should 
be merged.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]