Re: Running 'git pull' from an unnamed branch

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Björn
Date: Sunday, April 5, 2009 - 3:08 pm

On 2009.04.05 22:33:57 +0100, Reece Dunn wrote:

It doesn't "fix" anything, you're simply doing something different.

"git pull" while on a detached HEAD can't work, there are no defaults
that could be used. But e.g. "git pull origin master" would do, fetching
"master" from "origin" and merging it to the commit you have checked
out.

Your "git checkout master && git pull" does something else. It uses the
configured pull defaults for "master" to fetch something and merge it to
"master".


That's a bug, but it should not be branch.remote. The config setting is
branch.<name>.remote. As you were on a detached HEAD, there is no
"<name>", and the code that generates the error message doesn't handle
that correctly. I'd even say that in this case, the whole "If you often
merge ..." part makes no sense at all, you simply can't setup pull
defaults for a detached HEAD.


Hm? Neither do you really need to move to a branch, nor is "master"
really _that_ special that it is warranted to recommend checking it
out... IMHO.

Björn
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Running 'git pull' from an unnamed branch, Reece Dunn, (Sun Apr 5, 2:33 pm)
Re: Running 'git pull' from an unnamed branch, Sverre Rabbelier, (Sun Apr 5, 2:37 pm)
Re: Running 'git pull' from an unnamed branch, Markus Heidelberg, (Sun Apr 5, 2:42 pm)
Re: Running 'git pull' from an unnamed branch, Björn, (Sun Apr 5, 3:08 pm)
Re: Running 'git pull' from an unnamed branch, Reece Dunn, (Sun Apr 5, 3:15 pm)
Re: Running 'git pull' from an unnamed branch, Markus Heidelberg, (Sun Apr 5, 3:28 pm)
Re: Running 'git pull' from an unnamed branch, Reece Dunn, (Sun Apr 5, 3:29 pm)
Re: Running 'git pull' from an unnamed branch, Junio C Hamano, (Sun Apr 5, 6:05 pm)
Re: Running 'git pull' from an unnamed branch, Reece Dunn, (Mon Apr 6, 12:42 am)
Re: Running 'git pull' from an unnamed branch, Björn, (Mon Apr 6, 3:03 am)
Re: Running 'git pull' from an unnamed branch, Reece Dunn, (Mon Apr 6, 5:04 am)
Re: Running 'git pull' from an unnamed branch, Markus Heidelberg, (Mon Apr 6, 2:05 pm)