Subject: Re: git http-backend error message

From: "Scott R. Godin" <[email-masked]>
Date: Mon, 05 Apr 2010 10:52:47 -0400

On 03/15/2010 01:12 PM, Junio C Hamano wrote:
> Jeremiah Foster<[email-masked]>  writes:
>> 	Or is it smarter to just create a bare repository, clone some
>> 	content into it, and then push?
>
> It depends on what you are trying to achieve by pushing into this
> repository that is not bare, iow what this pushed-into repository is used
> for.
>
> Pushing into a repository is done for two reasons:
>
>   - You push into repository A so that the development done in other
>     repositories B, C, D,... can all be collected, kept safe, and
>     transferred out to other repositories (iow, B, C, D uses A as a shared
>     meeting place).
>
>     This is the primary use case of "push", and because in repository A
>     there will not be any development of its own, people make A a (shared)
>     bare repository.
>
>   - You do perform your own development in repository A, and you would want
>     to interact with other repositories B, C, D,..., by doing "git pull B"
>     etc., but for network configuration reasons, you can only make
>     connection to A from B, C, D..., and not in the other direction.  In
>     this case, because "git pull B" run on A is "git fetch B" followed by
>     "git merge", you substitute the first "git fetch B" part by running
>     "git push A" on B instead, because you can make connections from B to A
>     but not A to B.
>
>     In this case, you do not want your "git push A" run on B to overwrite
>     the branch that is checked out in A, and the above error is issued if
>     you attempted to do so.  This would show a proper arrangement for such
>     a "push instead of fetch":
>
>     http://git.wiki.kernel.org/index.php/GitFaq#push-is-reverse-of-fetch

Thanks, this actually helped clear up a few things for me as well. I 
haven't yet started working with remotes; mostly I've been using it to 
take care of things on my end (this is a bit less problematic since I 
mostly use it for web devel tracking anyway) and then rsync to the 
webserver. However, this is definitely going in my collection of notes 
and bookmarks for reference when I get to that point.

-- 
(please respond to the list as opposed to my email box directly,
unless you are supplying private information you don't want public
on the list)