From: Brian Gernhardt <benji@silverinsanity.com>
To: Ron Garret <ron1@flownet.com>
Cc: git@vger.kernel.org
Subject: Re: Individual file snapshots
Date: Fri, 12 Feb 2010 16:37:09 -0500 [thread overview]
Message-ID: <12B5BDAB-DD9C-4CED-9489-0773BF577DF3@silverinsanity.com> (raw)
In-Reply-To: <ron1-519083.13253112022010@news.gmane.org>
On Feb 12, 2010, at 4:25 PM, Ron Garret wrote:
> Yeah, I considered that. The problem with that is that the actual
> process turns out to be pretty obtrusive. The scenario is that I've
> done a bunch of hacking on the main branch and I realize that it's going
> nowhere. Nothing is working, everything is a horrible mess that's
> spinning wildly out of control. I want to get rid of everything I've
> done and start over from an earlier snapshot that I knew was working.
> But I also want to keep a copy of this current messy state around for
> reference just in case there's a snippet here and there that might be
> salvageable later on. I don't know of any easy way to save the messed
> up file onto another branch. I'd have to save the file somewhere (in
> the stash maybe?), check out the snapshot branch, retrieve the saved
> file, do the commit, and then switch back to the main branch.
Have you tried creating a new branch without saving the state?
git checkout -b failed-experiment
git commit -a -m "Back to the drawing board"
git checkout master
Or if a series of commits seem to have gone bad:
git commit -a -m "Well, that didn't work."
git branch failed-experiment
git reset --hard origin/master # or other good state
You can of course replace the -a to commit with the needed "git add <file>" commands and leave off the -m to leave real messages about why it went bad using $EDITOR.
~~ Brian
next prev parent reply other threads:[~2010-02-12 21:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-12 12:03 Individual file snapshots Ron Garret
2010-02-12 12:18 ` Peter Krefting
2010-02-12 17:24 ` Ron Garret
2010-02-12 20:41 ` René Scharfe
2010-02-12 21:25 ` Ron Garret
2010-02-12 21:37 ` Brian Gernhardt [this message]
2010-02-12 21:57 ` Ron Garret
2010-02-12 22:14 ` Junio C Hamano
2010-02-12 22:41 ` Ron Garret
2010-02-12 22:32 ` Brian Gernhardt
2010-02-12 22:39 ` Ron Garret
2010-02-13 0:33 ` Mark Lodato
2010-02-13 0:47 ` Junio C Hamano
2010-02-13 15:13 ` Mark Lodato
2010-02-13 18:41 ` Ron Garret
2010-02-13 18:58 ` Junio C Hamano
2010-02-13 7:01 ` Ron Garret
2010-02-13 3:00 ` Larry D'Anna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12B5BDAB-DD9C-4CED-9489-0773BF577DF3@silverinsanity.com \
--to=benji@silverinsanity.com \
--cc=git@vger.kernel.org \
--cc=ron1@flownet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).