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

Re: [RFC] Introduce .git/BRANCH to point to the current branch

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 4, 2007, 20:46 UTC
Message-ID
<7vir3e428i.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<m34peyur8r.fsf@roke.D-201>
Jakub Narebski <jnareb@gmail.com> writes:
Show 13 quoted lines
>> Currently, I can do:
>> 
>> # Oh, what did this look like two commits ago?
>> $ git checkout HEAD^^
>> # Ah, OK, let's go back to the tip
>> $ git checkout branch-name
>>                ^^^^^^^^^^^
>> But I have to remember and re-type the branch name.
>
> No, you don't have. You can use
>   $ git checkout ORIG_HEAD
> or
>   $ git checkout HEAD@{1}

But the point is he wants to go back to the branch he came from. He does not want to detach HEAD at the original commit.

Having said that, I am not sympathetic to "I have to remember".
Previous: Jakub NarebskiNext: Matthieu Moy
Message 4 of 14 in “[RFC] Introduce .git/BRANCH to point to the current branch”
  1. Salikh ZakirovDec 4, 2007
  2. Matthieu MoyDec 4, 2007
  3. Jakub NarebskiDec 4, 2007
  4. Junio C HamanoDec 4, 2007
  5. Matthieu MoyDec 4, 2007
  6. Junio C HamanoDec 4, 2007
  7. git-checkout --push/--popNanako Shiraishi, Dec 4, 2007
  8. Junio C HamanoDec 5, 2007
  9. Matthieu MoyDec 5, 2007
  10. David KågedalDec 5, 2007
  11. Robin RosenbergDec 6, 2007
  12. Salikh ZakirovDec 4, 2007
  13. Junio C HamanoDec 4, 2007
  14. Jakub NarebskiDec 4, 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.