From: Aneesh Kumar K.V Date: Thu, 07 Dec 2006 06:49:52 GMT Subject: Re: [PATCH] Explicitly add the default "git pull" behaviour to .git/config on clone Message-ID: <4577B990.9090708@gmail.com> In-Reply-To: <200612061207.23437.andyparkins@gmail.com> Andy Parkins wrote: > Without any specification in the .git/config file, git-pull will execute > "git-pull origin"; which in turn defaults to pull from the first "pull" > definition for the remote, "origin". > > This is a difficult set of defaults to track for a new user, and it's > difficult to see what tells git to do this (especially when it is > actually hard-coded behaviour). To ameliorate this slightly, this patch > explicitly specifies the default behaviour during a clone using the > "branch" section of the config. > > For example, a clone of a typical repository would create a .git/config > containing: > [remote "origin"] > url = proto://host/repo.git > fetch = refs/heads/master:refs/remotes/origin/master > [branch "master"] > remote = origin > merge = refs/heads/master > > The [branch "master"] section is such that there is no change to the > functionality of git-pull, but that functionality is now explicitly > documented. > > Signed-off-by: Andy Parkins > --- > This is really to help newbies. By explicitly documenting the default > behaviour, it makes it clearer what is going on. It also means no routing > through documentation to find out what config option needs changing. > > It's possible that we would want to remove the default behaviour entirely > if there is no "branch" definition in the config. That would prevent > accidents by users who don't know what pull does fully yet. > I liked this. This avoid lot of confusion and the "magic" master update. -aneesh