From: Brian Gernhardt Date: Tue, 13 Nov 2007 19:50:49 GMT Subject: Re: Cloning empty repositories, was Re: What is the idea for bare repositories? Message-ID: In-Reply-To: On Nov 13, 2007, at 5:50 AM, Matthieu Moy wrote: > While clone normally does a bit more: > > [remote "origin"] > url = /tmp/git1/.git > fetch = +refs/heads/*:refs/remotes/origin/* > [branch "master"] > remote = origin > merge = refs/heads/master But how is clone expected to do that when the origin is an empty repo? There is no branch for it to track, and automagically setting it to master is bogus because then it's tracking something that doesn't exist. The easy way to set up the last bit is "git checkout -b master --track origin/master". But that won't work if origin/master doesn't exist. The following will always work: git config branch.master.remote origin git config branch.master.merge refs/heads/master But asking git-clone do do this sort of odd magic for an empty repo is dubious at best. Perhaps convenient for your situation, but creates repos that don't actually work. (Will give errors when trying to merge a non-existent branch, at the very least.) ~~ Brian