I work on a project with a lot of branches.
我在一个有很多分支的项目上工作。
In my project folder I have a currently untracked folder that needs to be accessible from all branches. It contains a bunch of scripts that simulates the production environment but cuts down execution times of program calls that would otherwise take hours. These scripts are constantly refined to emulate the production environment more accurately.
在我的项目文件夹中,我有一个当前未跟踪的文件夹,需要从所有分支机构访问。它包含一组模拟生产环境的脚本,但会减少程序调用的执行时间,否则需要花费数小时。这些脚本不断完善,以更准确地模拟生产环境。
I want to track this folder in my repo, but any changes I make to it, need to be accessible from any branch. How can I track this folder but still have it behave like it was untracked?
我想在我的仓库中跟踪这个文件夹,但是我对它所做的任何更改都需要可以从任何分支访问。如何跟踪此文件夹,但仍然表现得像未跟踪?
1 个解决方案
#1
2
If changes to this directory are orthogonal to changes in other directories, perhaps it should live in a different Git repository.
如果对此目录的更改与其他目录中的更改正交,则可能它应该位于不同的Git存储库中。
You can just check out that other repository into the right place inside the main one, but then everyone who wants to use the scripts will need to check it out into the same place (not necessarily a huge problem).
您可以将其他存储库检出到主要存储库中的正确位置,但是然后每个想要使用脚本的人都需要将它们检出到同一个地方(不一定是个大问题)。
If you want to get fancier, check out Git submodules. However, a submodule does exist at a specified commit, so that's probably not suitable for your case.
如果你想获得更好的,请查看Git子模块。但是,子模块确实存在于指定的提交中,因此可能不适合您的情况。
#1
2
If changes to this directory are orthogonal to changes in other directories, perhaps it should live in a different Git repository.
如果对此目录的更改与其他目录中的更改正交,则可能它应该位于不同的Git存储库中。
You can just check out that other repository into the right place inside the main one, but then everyone who wants to use the scripts will need to check it out into the same place (not necessarily a huge problem).
您可以将其他存储库检出到主要存储库中的正确位置,但是然后每个想要使用脚本的人都需要将它们检出到同一个地方(不一定是个大问题)。
If you want to get fancier, check out Git submodules. However, a submodule does exist at a specified commit, so that's probably not suitable for your case.
如果你想获得更好的,请查看Git子模块。但是,子模块确实存在于指定的提交中,因此可能不适合您的情况。