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

Re: getting started, happy with cmd line on windows [Scanned]

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 26, 2008, 23:50 UTC
Message-ID
<7v4p0qlcnc.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<gj3of4$pr3$3@ger.gmane.org>
"Zorba" <cr@altmore.co.uk> writes:
Show 16 quoted lines
> Now, I went back and read the manual pages for git-checkout and think I see 
> how to do it....
>
> $ <import code>
> $ git init
> $ git commit
> $ git tag versionA <commitID>
> $ hack hack hack
> ...
> now ready to start coding, want "last known good"
> $ rm *.*
> $ git checkout versionA .
>
> This worked fine when versionA had only files and no dirs - but will it work 
> ok still if versionA is a proper tree ?
> (more of a unix question I suppose - will "." suffice as the path ?) 
Drop "rm *.*".  Instead, probably what you want is
> $ <import code>
> $ git init
> $ git commit
which is a good way to make an initial import.
> $ git tag versionA <commitID>
> $ hack hack hack
> ...

and you futzed with the codebase without any intention of committing; it is nice to be able to experiment freely.

After you are done experimenting,
$ git reset --hard versionA

if you did not make any commit, or even if you did commit while you were experimenting, if you do not want these experimental commits at all.

No need for "rm *.*" anywhere.
Previous: ZorbaNext: Zorba
Message 4 of 7 in “getting started, happy with cmd line on windows [Scanned]”
  1. Conor RaffertyDec 26, 2008
  2. René ScharfeDec 26, 2008
  3. ZorbaDec 26, 2008
  4. Junio C HamanoDec 26, 2008
  5. ZorbaDec 27, 2008
  6. Daniel BarkalowDec 28, 2008
  7. ZorbaDec 30, 2008

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.