0

Okay, here's a weird one!

I have this nifty little 32gig thumbdrive that I keep in my wallet that contains all the latest of EVERY file I need to go about life on a computer. It contains all my BASH command references, everything from rubiks cube algorithms to PDFs I use for references and digital books and all the software I've ever written. Friend need their computer fixed all of a sudden? BANG! I got it covered with the software in my left pocket. Sweet huh?

Well I want to keep track of every change I make to the repo as well as have constant backups of it. Git works pretty well for this, except that it copies all my files and inflates the repo's size drastically! This isn't really a big problem but it is annoying. I know Git is used for software repos and I'm cool with that (Thats what I primarily use it for anyways)

So I was thinking, could I somehow as a git nub use git to record changes I made to the repo but NOT keep a running copy of every actual change but only keep the HEAD version? So when I do a push/pull the repo would be backed up with all my comments but ONLY what is in the active directory tree within the flash drive would be saved in the Git repository? So there wouldn't be duplicate binary entries, if I removed a .exe file it would log it but get rid of the file forever?

Maybe there is a better way of doing this without using git? For instance I WAS using 7ZIP to compress and make backups manually, then saving them to a cloud server for backup redundancy. That was time intensive and much more annoying than a simple:

git add .
git commit -m "changes"
(git gc)
git push

Any help would be greatly appreciated!

Parad0x13
  • 2,007
  • 3
  • 23
  • 38

3 Answers3

3

git-annex does what you want. It uses git-plumbing for version control but without having a copy in the index and in the repository.

Ozan
  • 4,345
  • 2
  • 23
  • 35
1

If I'm understanding you correctly, you want a log of what files were touched, when and a human written description of what was changed... but you don't want the actual changes, just the latest.

Write a changes file by hand (or maybe write a little script to get the timestamps and changes files) and use rsync to keep the files in sync. Simple.

But really you're going to want a full repository of changes (if you don't want it now, you will want it six months from now) just not on your flash drive. I'm not sure why you'd want the log of changes you've made on your flash drive, so I'll drop that requirement. What I would recommend instead is to do your development on a real disk with a full git repository and with full backups. Then deploy the files to your flash drive. There's a few ways to do that.

One is to use rsync. Its really good at that and easily available.

Or make a shallow clone on your flash drive with git clone --depth 0 <repo>. This way you can still pull, diff and commit. You will not have the full log, but I don't see why you'd need it on your flash drive. You cannot push from this repository, but you can still do a diff to see local changes and create a patch file. You shouldn't be developing on your flash drive anyway.

Schwern
  • 153,029
  • 25
  • 195
  • 336
  • These are some really good inputs. Perhaps I should rethink the way I'm managing this file system. I originally wanted the flash drive to be THE LATEST everything, so I can on the go update anything on the drive and consider its contents final, i'd then go and backup the drive elsewhere. I really want to have running copies of the file system on my mac, pc, hacked tablet etc... but whatever is on the flash drive would be considered final – Parad0x13 Dec 01 '12 at 23:29
0

Sounds like you want a centralized source control system, like Subversion. The entire point of Git is to have a repository locally. With Subversion, you'd have one central copy, and carry just a working copy around on your thumbdrive.

The central copy would still have the full history, though I think it might be easier to remove old commits from Subversion than from Git.

Thomas
  • 174,939
  • 50
  • 355
  • 478