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

Re: My first git success

From
PEPeter Eriksen <s022018@student.dtu.dk>
Date
Jan 13, 2006, 20:14 UTC
Message-ID
<20060113201421.GA25252@ebar091.ebar.dtu.dk>
In-Reply-To
<86y81kvtvj.fsf@blue.stonehenge.com>
On Fri, Jan 13, 2006 at 10:57:04AM -0800, Randal L. Schwartz wrote:
Show 16 quoted lines
> >>>>> "Linus" == Linus Torvalds <torvalds@osdl.org> writes:
> 
> Linus> I still hope the exchanges will result in more docs, or at least other 
> Linus> lurkers on the list also learning a new trick or two..
> 
> I've also enjoyed a bit of success putting a website under git.  I started
> working on AJAX-ing some of the code, but I needed to do maintainence on the
> live site, so I've just simply done "git-checkout master" to work on that, and
> "git-checkout ajax; git-pull . master" when I want to continue work on the
> ajax upgrades.
> 
> However, before I bug-fix, I have to "snapshot" any working changes in the
> ajax branch or I would lose them on "git-checkout master", which gives me
> commits that look like "snapshot".  Am I doing that wrong?  Is there a better
> way to do parallel development of a "live vs upgrade" branch, and make commits
> only when I make progress?
I've been wondering this myself.  Perhaps the following way would work?
    git checkout ajax          # Work on the ajax branch.
    git diff HEAD >ajaxdiff
    git checkout -f master     # Work on the bug fix in master.
    git commit -a -m "Bug fix in master"
    git checkout ajax
    git apply ajaxdiff
    git commit -a -m "Finished commit in ajax"
This is untested, so it's only for inspiration.
Regards,
Peter
Previous: Junio C HamanoNext: walt
Message 5 of 15 in “My first git success”
  1. waltJan 13, 2006
  2. Linus TorvaldsJan 13, 2006
  3. Randal L. SchwartzJan 13, 2006
  4. Junio C HamanoJan 13, 2006
  5. Peter EriksenJan 13, 2006
  6. waltJan 14, 2006
  7. seanJan 14, 2006
  8. waltJan 14, 2006
  9. Randal L. SchwartzJan 14, 2006
  10. Junio C HamanoJan 14, 2006
  11. Linus TorvaldsJan 14, 2006
  12. waltJan 14, 2006
  13. Junio C HamanoJan 14, 2006
  14. Linus TorvaldsJan 14, 2006
  15. Junio C HamanoJan 15, 2006

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.