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

Re: Newbie falls at first hurdle

From
Alan Chandler <alan@chandlerfamily.org.uk>
Date
Sep 18, 2005, 19:11 UTC
Message-ID
<200509182011.10689.alan@chandlerfamily.org.uk>
In-Reply-To
<7vek7m5m0z.fsf@assigned-by-dhcp.cox.net>
On Sunday 18 Sep 2005 18:22, Junio C Hamano wrote:
> Alan Chandler <alan@chandlerfamily.org.uk> writes:
Show 7 quoted lines
> > Still struggling with how to cherry pick parts a previous
> > update (between possibly two other branches) and apply them to
> > a current branch - all the tutorials assume you want it all,
> > and I can't really understand what the cherry pick commands do
> > from their manuals.
>
> An example to pick a couple of commits from one branch to another.

I understood your example (on the assumption I don't really care what pu^2~2 actually means as its copied from a list) and that is a new piece of useful information that I didn't have before, (and which I would have used several times this afternoon had I known) but its not exactly what I meant.

Before using git I had made a lot of unrelated changes to my working directory, some of which were bad. The only way to get a snapshot before I made it bad (trying to hack a combination CSS and dynamically created html to get it to do what I want - mind breaking:-( ) was to go back to the previous days backup of the whole working directory.

It was this mess I had got myself into that kicked me into getting into git, rather than waiting for the 1.0 release, which had been my previous plan.

I effectively loaded both my current code and the day before's backup into git as two separate branches.

What I was then trying to do, via various attempts with git diff -p was to extract small chunks of updates (ie limit scope over a few files). Edit the result to limit the diff to cover a small update and then apply it to a my current stuff to slowly undo some of the mess that I had made.

Being new to git, meant reading man pages all the time - which was making it slow progress (and which wasn't helped by realising I had an old version of the man pages installed part way through :-( ). In the end it was easier to manually retrace my steps by typing in the changes I needed.

-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 13 in “Re: Newbie falls at first hurdle”
  1. Horst von BrandSep 18, 2005
  2. Martin LanghoffSep 18, 2005
  3. Alan ChandlerSep 18, 2005
  4. Junio C HamanoSep 18, 2005
  5. Linus TorvaldsSep 18, 2005
  6. Junio C HamanoSep 18, 2005
  7. Alan ChandlerSep 18, 2005
  8. Junio C HamanoSep 18, 2005
  9. Sven VerdoolaegeSep 19, 2005
  10. Martin LanghoffSep 18, 2005
  11. Horst von BrandOct 3, 2005
  12. Horst H. von BrandJan 13, 2007
  13. Shawn O. PearceJan 13, 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.