git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Running 'git pull' from an unnamed branch

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Apr 5, 2009, 21:42 UTC
Message-ID
<200904052342.44856.markus.heidelberg@web.de>
In-Reply-To
<3f4fd2640904051433u199587c3wc9bf080d138944e7@mail.gmail.com>
Reece Dunn, 05.04.2009:
Show 17 quoted lines
> Hi,
> 
> Here is something I have just recently tripped up on.
> 
> $ git pull
> 
> [..]
> 
> $ git branch
> * (no branch)
>   master
> 
> Running `git checkout master && git pull` fixed the above issue. The
> patch below improves the error message for users that are in this
> state.
> 
> Also, is "branch..remote" valid? Should this be "branch.remote"?

The current branch has no name, so there is nothing between the two dots. For clarification: branch.(no branch).remote

> +	echo "You may not be on a branch. In this case, you need to move"
> +	echo "onto the branch you want to pull to (usually master):"
> +	echo "    git checkout <branch>"
> +	echo

Not being on a branch is not the general case when you receive this message. Maybe determining if you are not on a branch and adjusting the message acordingly is an option.

Markus
Previous: Sverre RabbelierNext: Reece Dunn
Message 3 of 12 in “Running 'git pull' from an unnamed branch”
  1. Reece DunnApr 5, 2009
  2. Sverre RabbelierApr 5, 2009
  3. Markus HeidelbergApr 5, 2009
  4. Reece DunnApr 5, 2009
  5. Markus HeidelbergApr 5, 2009
  6. Björn SteinbrinkApr 5, 2009
  7. Reece DunnApr 5, 2009
  8. Junio C HamanoApr 6, 2009
  9. Reece DunnApr 6, 2009
  10. Björn SteinbrinkApr 6, 2009
  11. Reece DunnApr 6, 2009
  12. Markus HeidelbergApr 6, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.