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

Re: What does git reset do?

From
OAOctavio Alvarez <alvarezp@alvarezp.ods.org>
Date
Feb 2, 2010, 08:37 UTC
Message-ID
<op.u7hrj8vb4oyyg1@localhost.localdomain>
In-Reply-To
<ron1-2B8474.00242602022010@news.gmane.org>
On Tue, 02 Feb 2010 00:24:26 -0800, Ron Garret <ron1@flownet.com> wrote:
Show 14 quoted lines
> In article <op.u7hpv8nd4oyyg1@localhost.localdomain>,
>  "Octavio Alvarez" <alvarezp@alvarezp.ods.org> wrote:
>
>> > So... what does git reset do?
>>
>> Sets the current head (and branch, if not detached) to the specified
>> commit...
>
> Ah.  It's the "and branch" part that I was missing.  Thanks!
>
> Hm... maybe "detached head" is not as inappropriate a term as I first
> thought.  When you checkout a branch, HEAD really is "attached" to the
> branch insofar as the branch head gets "dragged along" on commits and
> resets.  (Have I got that right?)
99% right. I'm just not sure if there is such thing as "branch head".

You may compare the branch with a "moving tag", in which case the branch is just a pointer, so "branch head" would be redundant, and besides "HEAD" is an already used term. So you may say simply "branch" instead.

But it's easy intuitive to compare it with a bunch of related commits, each parent of another. And gitk also has a line that says "branch: _____, ______, ______" for each commit.

In any case, it's just a matter of getting the terms to match the developers'.

-- 
--
Octavio.
Previous: Ron GarretNext: Jakub Narebski
Message 4 of 5 in “What does git reset do?”
  1. Ron GarretFeb 2, 2010
  2. Octavio AlvarezFeb 2, 2010
  3. Ron GarretFeb 2, 2010
  4. Octavio AlvarezFeb 2, 2010
  5. Jakub NarebskiFeb 2, 2010

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.