1

I have the same problem as this guy How do I manage built files in different branches?. And as far as I understand this problem the solution should be to force git not to store whole history for some sort of files. If it could be able not to ignore built binaries but store it in a branch, this will solve the problem. But this binaries shouldn't be tracked as a normal sources. Each this binary should be only "stored" in a branch, only the very last version of it and without any history of previous deleted or modified versions.

Now git-stash have switch "save --all" but stash isn't a per branch store, it couln't be used as a permanent store for precompiled binaries in every branch. Yes? Any other ideas?

Also I wonder is it possible to do such trick in svn or may be in any other version control system? Even so svn will be slow for binaries... but just curious.

Community
  • 1
  • 1
ZAB
  • 963
  • 10
  • 18

2 Answers2

4

The solution to the question you reference, is not to store these files in the repository at all, but rather to store them on the file system, in a location that is untracked by version control.

In general, there is no point in storing files in version control that are automatically built from your other sources. VCS is for tracking history of files, especially source files and other files which are manually changed. If you are not interested in the history of a file, and especially if it is a large binary build artifact, then the place for it is the file system, not VCS.

Avi
  • 19,934
  • 4
  • 57
  • 70
  • Generally speaking yes. But wait a minute... will you vote to cut of git-stash feature from git because it is not the main goal of VCS? The goal of VCS not only to track history of a file but also provide the way to easily deal with this history, different versions and branches. I think that storing binary in a "per-branch-stash" is useful. And the point is to store one copy of a binary for each branch and manage them with this branch, copy on branching etc. And it would be possible if I can force git not to store history for some sort of files. – ZAB Sep 13 '11 at 14:29
  • git-stash is a useful feature, *related to VCS* - it makes it easy to save diffs while changing the working copy to different branches. – Avi Sep 13 '11 at 14:42
  • You could easily add this feature to a script you call which switches between branches. For example, you could have a git-switch script, which copies a copy of the file from your current branch to tmp/BRANCH_NAME/file, and copies the file from tmp/OTHER_BRANCH/file out to the working copy, before doing git checkout (where the file and all of tmp/ are in .gitignore). – Avi Sep 13 '11 at 14:44
0

Take a look at git media for one possible solution that may fit your needs.

Karl Bielefeldt
  • 47,314
  • 10
  • 60
  • 94