aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Cleaning out old versions in git Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Cleaning out old versions in git" Watch "Cleaning out old versions in git" New topic
Author

Cleaning out old versions in git

Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Is there a way to clear out old versions of a file in git? I have some files where I don't need a full revision history, just the last couple versions.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Does it really matter? I mean, why bother?
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Because I have some large files and I don't need to store a lot of versions of them.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

Most version control systems don't keep complete copies of every generation of a file, only the differences between the generations. Obviously, this works better when you're storing generations of source code than generations of binary files, though some systems have the ability to detect differences even in certain types of binary files.

Version control systems are based on the idea that everything is important or it wouldn't be in the Version control system, so chewing holes in the archive is counter-productive. If you really don't care about recreating how the system was back last September, you'd be better off constructing a new archive (or project archive), copying the current system over and simply deleting the whole previous archive.

For internal IT usage, only keeping recent generations might seem reasonable, but VCS systems were intended to support mass-market (including open-source) software, and if people could, they'd still be calling Microsoft for support for Windows 95, which is why it's preferable for them to be able to construct the software as it existed back then (and still does on the client's computer).


Customer surveys are for companies who didn't pay proper attention to begin with.
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Tim Holloway wrote:Most version control systems don't keep complete copies of every generation of a file, only the differences between the generations. Obviously, this works better when you're storing generations of source code than generations of binary files, though some systems have the ability to detect differences even in certain types of binary files.

Version control systems are based on the idea that everything is important or it wouldn't be in the Version control system, so chewing holes in the archive is counter-productive. If you really don't care about recreating how the system was back last September, you'd be better off constructing a new archive (or project archive), copying the current system over and simply deleting the whole previous archive.

For internal IT usage, only keeping recent generations might seem reasonable, but VCS systems were intended to support mass-market (including open-source) software, and if people could, they'd still be calling Microsoft for support for Windows 95, which is why it's preferable for them to be able to construct the software as it existed back then (and still does on the client's computer).


-nods- I understand that it's not a normal request. And that it's a bad setup. However, it's something I've inherited, and until I have a chance to redo everything, I'm stuck with it. Just trying not to fill up the disk with multiple versions of a binary file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cleaning out old versions in git