How to organize additional project material separately using Git?

I want all project files, such as source code, to be part of the repository. For simplicity, all work is done in the development branch. In addition, I want to include additional project materials, such as pdf files. I do not want to add them to the development branch. So far I have come up with the following strategies.

  • Strategy 1 is to create separate industry material and add PDF files. A branch shares some story with its parent branch.
  • Strategy 2 adapts the first strategy, and also from time to time combines the fixations of the material branch in the development branch. (I do not want this, and this is lavash.)
  • Strategy 3 is to create an orphan branch that does not use source code history, for example.
  • Strategy 4 - follow strategy 1 or 3 and additionally create a submodule that represents only the material branch of the "main" repository. If possible, the working directory will show the development branch and the material branch at the same time.

The disadvantage of all strategies is that I cannot access the files in the working directory when I checked another branch.
How can I work in the development branch and at the same time have material available in the working directory? If you find it easier to imagine, the material may also be documentation.


Edit: I added strategy 4. after reading Seth Robertson 's answer .

+4
source share
1 answer

Well, you could split the PDF files into a separate repository and use something like a gitslave or git subset to link the two projects together.

One extension of this idea when using git -submodules (not gitslave) is that you could actually make the “other repository” your local repository on another branch (I don’t see how git could tell about it separately from another case - with the exception of blocking exception, if you are actually using the same repo instead of cloning from upstream).

Of course, with git substitutions, you may (or not have) problems combining SHA in a pdf repo. gitslave will not have this problem.

+2
source

All Articles