On Thu, 03 May 2012 18:20:43 +0200, Hallvard Furuseth wrote: > On Thu, 03 May 2012 16:09:15 -0000, Michael Witten wrote: > >> On Thu, 03 May 2012 14:23:59 +0200, Hallvard Furuseth wrote: >> >>> I mean 'git clone --bare bar.git foo.git' does not give foo.git >>> a remote named 'origin' with a branch origin/master. Not sure >>> if there is a _simple_ way to do it well either. init + fetch >>> above does not try to hardlink objects/packs like clone does. >>> >>>> (...) >>>> $ git init bar.git; cd bar.git >>>> $ echo a > a; git add a; git commit -m a; cd .. >>>> $ git clone --bare bar.git foo.git; cd foo.git >>> >>> $ git branch -a >>> * master >> >> From `git help clone': >> >> --bare >> Make a bare GIT repository. That is, instead of creating >> <directory> and placing the administrative files in >> <directory>/.git, make the <directory> itself the $GIT_DIR. >> This obviously implies the -n because there is nowhere to >> check out the working tree. Also the branch heads at the >> remote are copied directly to corresponding local branch >> heads, without mapping them to refs/remotes/origin/. When >> this option is used, neither remote-tracking branches nor the >> related configuration variables are created. > > Yes, I know. I just don't know why. I imagine that the purpose behind a bare repository is really just to provide a repository into which objects may be pushed and from which objects may be fetched, and that's it; it's sole purpose is to act as a point of communication. Cloning a repository with --bare is meant to simplify the task of setting up a bare repository with some initial content. Fortunately, we're talking about the history of a revision control system. I found this with `git blame -L70,76 71821351^ git-clone.txt': commit 4fb66a62eeb7bfec115cd0058d7a05ab62fc23e7 Author: Junio C Hamano <junkio@xxxxxxx> Date: Sun Jan 22 17:27:52 2006 -0800 clone: do not create remotes/origin nor origin branch in a bare repository. It is simply pointless, since no merges will ever happen in such a repository. Signed-off-by: Junio C Hamano <junkio@xxxxxxx> That certainly corroborates the limited purpose of a bare repository. -- 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