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

Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-)

From
ZZorba <cr@altmore.co.uk>
Date
Dec 30, 2008, 04:17 UTC
Message-ID
<gjc7qa$jdj$4@ger.gmane.org>
In-Reply-To
<3ab397d0812291505v77824e6fvdecebc80f38a5f89@mail.gmail.com>
Hi Jeff,

Thanks for your contrib. I'll pick these up for sure, but right now I'm despo to make some progress getting this confounded real-life project versioned.

But where I'm stuck now touches on your post.
I've just made a commit I want to retract.

I have been using $ git reset --hard <version> as an escalator to ascend / descend the versions up and down Surely it doesn't alter the history, as I can commit versionA, versionB, versionC, and then reset to A, then reset to C, then reset to B.

so when I reset to A, I've still got the ability to get to B or C again

Now I appreciate that if I commit a new change from versionA (lets call it B1), then HEAD is now at B1, and B, C etc are lost, correct ?

Its pertinent to where I am right now, as I've goofed a commit, and want to reset, and commit again but I'm worried about leaveing garbage lying around (the commits for version B and C in the example above).

NB if you read my latest posts you will see why I chose the example I did for my "warm-up" as it closely models what I'm trying to do for real.

BTW: sdf=Syntax Definition Formalism?

"Jeff Whiteside" <jeff.m.whiteside@gmail.com> wrote in message news:3ab397d0812291505v77824e6fvdecebc80f38a5f89@mail.gmail.com...

-"Rollback to each of the versions, starting with version A" this is bad. you're saying rollback. to others that have used scms, this will mean, "retrieve an older copy", but in git, this is DELETING all the versions after the version that you "rollback" to. your blog post shouldn't discuss the git-reset --hard command at all, since you're rewriting history, which is dangerous. afaik, most scms don't allow you to rewrite history. to "rollback" to an older version you should use checkout the git-checkout command. maybe the git reset -–hard HEAD is okay to include... but it won't be immediately obvious to new users why it does what it does... this nomenclature was likely not the best choice whenever it was made.

gl with your gitting.
whiteside
u're talking sdf
On Sat, Dec 27, 2008 at 5:29 PM, Zorba <cr@altmore.co.uk> wrote:
Show 33 quoted lines
>
> tidied up the formatting, added a few more comments where needed, fixed
> errors/lack of clarity
>
> "Zorba" <cr@altmore.co.uk> wrote in message
> news:gj68a0$u56$3@ger.gmane.org...
> > Here is a little exercise / tutorial / warm-up for someone starting out
> > with Git. If you're anyting like me you may find the tutorials etc. on
> > git.or.cz a bit daunting. I recommend you try this after reading the 
> > user
> > manual but before tearing your hair out trying to follow all the 
> > examples
> > in the user manual. After you've followed this simple workflow, then go
> > back to the more advanced stuff  in the tutorials and user manuals (like
> > cloning repositories and creating and merging branches).
> >
> > I created this exercise to try and model our workflow and what we wanted
> > to use git for = tracking a project with multiple files where the 
> > filebase
> > might change frequently from one version to the next.
> >
> > http://siliconmouth.wordpress.com/category/nerdy/
> >
> > look for December 27, 2008 or "git warmup"
> >
> >
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html 
Previous: Jeff WhitesideNext: Jeff Whiteside
Message 4 of 21 in “for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-)”
  1. ZorbaDec 27, 2008
  2. ZorbaDec 28, 2008
  3. Jeff WhitesideDec 29, 2008
  4. ZorbaDec 30, 2008
  5. Jeff WhitesideDec 30, 2008
  6. ZorbaDec 30, 2008
  7. Sitaram ChamartyDec 30, 2008
  8. ZorbaDec 30, 2008
  9. ZorbaDec 30, 2008
  10. ZorbaDec 30, 2008
  11. Jeff WhitesideDec 30, 2008
  12. ZorbaDec 30, 2008
  13. Jeff WhitesideDec 30, 2008
  14. Daniel BarkalowDec 30, 2008
  15. ZorbaDec 31, 2008
  16. ZorbaDec 30, 2008
  17. Boyd Stephen Smith Jr.Dec 30, 2008
  18. Boyd Stephen Smith Jr.Dec 30, 2008
  19. Boyd Stephen Smith Jr.Dec 30, 2008
  20. Sitaram ChamartyDec 31, 2008
  21. Daniel BarkalowDec 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.