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

Re: git -- how to revert build to as-originally-cloned?

From
GSGeorge Spelvin <linux@horizon.com>
Date
May 20, 2011, 20:22 UTC
Message-ID
<20110520202220.24482.qmail@science.horizon.com>
In-Reply-To
<4DD6BE8D.4080708@hotmail.com>
> I have tried gitk.  Can you or someone tell me what the colours of
> the nodes in the top left signifies?  Specifically, a commit of mine
> (done since all the merging I've been asking about) shows as yellow,
> whereas all the ones prior to that show as blue.

Nothing. It just tries to use different colours so you can tell the lines apart. But the specific colour is no more meaningful than shadings on a map.

Show 5 quoted lines
> So what would be the correct way,  before doing my fast-forward merge,
> to have made some kind of mark pointing at "a",  which I could then have
> used to undo the fast-forward,  without having to calculate the number
> of commits in between?  (supposing my branch was not anchored at "a"
> but at some much earlier point)?

The basic tool to do that is "git tag <name>", which creates a tag with the given name. (The difference between a tag and a branch is simply that a branch is updated when you commit.)

However, most people don't bother with an explicit name; see the man page for git-rev-parse for a list of all the ways to refer to old revisions. @{1} is the usual syntax for "the current branch before the last change", or you can use the older name ORIG_HEAD, too.

"git reflog" will show an extended history.
Previous: Paul EbermannNext: George Spelvin
Message 4 of 5 in “RE: git -- how to revert build to as-originally-cloned?”
  1. George SpelvinMay 20, 2011
  2. John LumbyMay 20, 2011
  3. Paul EbermannMay 20, 2011
  4. George SpelvinMay 20, 2011
  5. George SpelvinMay 20, 2011

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.