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

git checkout won't detach head when a reference equals the detach point

From
APAndy Parkins <andyparkins@gmail.com>
Date
Feb 18, 2007, 18:41 UTC
Message-ID
<200702181841.36203.andyparkins@gmail.com>
Hello,
Kind of convoluted, and perhaps not even an error.

On a repository with a remote tracking branch, say remotes/origin/master, then do this:

git checkout -b temp origin/master
git checkout origin/master
git branch
 * temp

This might seem like an odd thing to want to do, but I found this because the next thing I wanted to do was

git branch -D temp
Which won't work because the branch hasn't changed.
Andy
-- 
Dr Andrew Parkins, M Eng (Hons), AMIEE
andyparkins@gmail.com
Message 1 of 1 in “git checkout won't detach head when a reference equals the detach point”
  1. Andy ParkinsFeb 18, 2007

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.