Git - archive of old commits

I want to use Git to track micro replacements (several times a day) in a large working directory (many concerts). The data will be mixed binary / plain text. Binary data will not change much the same as text information. Access to old commits is rarely needed and can be slow, while recent history should be fast.

I don’t want to lose the old data forever, just move it to the backup server or something like that. Is there something in Git that allows you to archive the old history and only store a specific subset in the local repository?

If not, is there a tool that is more suitable for this purpose? I like Git because I know it, and I want version control and differences. I don't need any additional Git features (e.g. fork / merge, non-proliferation), so any other similar VCS would be nice.

+7
source share
1 answer

If you are fixing with git format-patch , create a shallow clone with git clone --depth <depth> and the procedure. Most likely you are not, in which case you are likely to find this answer and this answer is useful. The second one concludes that git checkout --orphan is perhaps the best way to get what you want. Of course, you still have to clone the entire story locally once to create a smaller branch.

If you feel adventurous, you want it bad, and you are ready to put up with the more complex push process, creating patches using git format-patch and applying them to another repository using git am not difficult to execute and not a script. This will add an extra layer to your push process - for example. create a patch on a shallow repo, programmatically apply to a complete repo, which either locally or somewhere else pushes from the latter. Probably time and problems are not worth it, but it is certainly possible.

+4
source

All Articles