• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cleaning out old versions in git

 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it really matter? I mean, why bother?
 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because I have some large files and I don't need to store a lot of versions of them.
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic