Re: Individual file snapshots

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <7v1vgqksoz.fsf@xxxxxxxxxxxxxxxxxxxxxxxx>,
 Junio C Hamano <gitster@xxxxxxxxx> wrote:

> Ron Garret <ron1@xxxxxxxxxxx> writes:
> 
> >> 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.
> >
> > That would require a separate branch for every snapshot, no?  I want 
> > this to be lightweight.  It's not so much the creation of a zillion 
> > branches that bothers me, but having to come up with a new name every 
> > time would be a real hassle.
> 
> Perhaps "stash"?
> 
> Usually stash is used to store "diff between stash@{N}^1 and stash@{N}",
> and "stash pop" or "stash apply" are geared toward that usage.  But you
> can use it as a way to keep snapshots.  You would be interacting with
> the stash differently, though.  E.g.
> 
> 	git diff stash@{4}
> 	git diff origin/master stash@{2}
> 	git checkout stash -- Makefile

No, I don't really want to usurp the stash for this.  But I think a 
separate disjoint branch (with an empty root) will work.  I think I can 
use git checkout to move the files back and forth between the main 
branch and the snapshot branch without causing merge problems if the 
snapshot branch is disjoint.

rg

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]