Re: Individual file snapshots

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

 



On Feb 12, 2010, at 4:57 PM, Ron Garret wrote:

> 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.

Ahhhh...  You could just use the stash and use some kind of recognizable message: git stash Failed: fooed the bar badly

Or you could make a stash-like snapshot branch?  The following sequence does something like that:

  git add .
  git commit -m "Ooops"
  git branch -f
  git reset --hard HEAD^

After a few failures like that, you can look over all the snapshots with

  git log -g snapshots

By default they will be kept around for 30 days, or the current setting of gc.reflogexpireunreachable.  If you want to keep a snapshot around for more than 30 days, you probably want to give it a real branch anyway.

You could either create a script that uses the above commands or a patch that makes git-stash take a --ref= argument and then set:

  alias.snapshot = stash --ref=refs/snapshots

~~ Brian--
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]