In GIT, what is the best way for a project to mix old and new versions of subcomponents?

Suppose a project needs to use an old frozen version of Component1 (for example, version Rev1), but the current (main) version of all other files. Component1 is a directory in the same repository.

GIT "viewing the entire set of files" seems inconvenient in this case. In CVS, you can simply put a sticky tag on Component1 to freeze these files in Rev1 or even where all other files remain on the main branch.

The repository is used for other projects that want to use the latest component Component1, so we can’t just roll back updates to Component1.

One possibility is to create a branch in Rev1, but then you need to constantly merge updates with all other files from the wizard. Moreover, I have to be very careful in these merges, so as not to accidentally merge any updates in Component1, which is easy to do in GIT, because commits by default automatically after the merge.

Mapping Component1 as a submodule will provide more control, but in this case all files will share a common repository.

"git checkout <rev> - Component1" allows me to select a specific version of a component, but I can’t fix this for mastering or merging a branch in master that makes this choice of revision, or else it will be available for all other projects.

Any other suggestions would be appreciated.

+4
source share
1 answer

You can create a subtree. The explanation is here. http://www.betaful.com/2011/01/i-love-git-subtree/

0
source

All Articles