[英]Proper version control workflow for a mixture of repositories
Would appreciate your feedback on the following (I'm a Git
beginner). 感谢您对以下内容的反馈(我是
Git
初学者)。 I have a public repo on GitHub
for my dissertation study's artifacts (mostly software, written in R
). 我在
GitHub
有一个公开回购,用于研究论文的工件 (主要是用R
编写的软件)。 I'd like to adapt a third-party GitHub
repo, containing LaTeX
dissertation template (basically, I want to periodically sync with it, merging changes, which I want/need). 我想修改一个包含
LaTeX
学位论文模板的第三方GitHub
库(基本上,我想定期与之同步 ,合并我想要/需要的更改)。 I've created corresponding submodule for the manuscript within my main project directory structure. 我已经在主项目目录结构中为稿件创建了相应的子模块。 However, now I questioning whether this route is the best (optimal).
但是,现在我质疑这条路线是否是最佳(最佳)路线。 My questions :
我的问题 :
1) What is the proper workflow for the above-mentioned task? 1)完成上述任务的正确工作流程是什么?
2) Would is be an approximate equivalent to use a branch for the manuscript (within main directory structure) instead of a submodule ? 2)在原稿目录(在主目录结构内)而不是子模块中使用分支将近似等效吗? The reason I'm asking this is that it seems that the IDE I'm using for practically all my work on the project (
RStudio
) doesn't seem to currently support submodules (awaiting confirmation from the team), however it does support branches. 我问这个问题的原因是,似乎我在项目(
RStudio
)上进行的几乎所有工作都使用的IDE当前似乎不支持子模块(等待团队的确认),但是它确实支持分支。 If such replacement makes sense, would I still be able to sync my now branch for the template (mostly in a read-only mode, but it'd be great to be able to push some changes upstream, too). 如果这样的替换有意义,那么我仍然可以同步模板的now分支(主要是在只读模式下,但是也能够将一些更改推入上游是很棒的)。
If it doesn't support submodule, but you still need to push changes upstream, you could consider using subtree instead. 如果它不支持子模块,但是您仍然需要向上游推送更改,则可以考虑使用子树 。
See an example at " Apply gradle file from different repository ". 请参阅“ 从不同存储库应用gradle文件 ”中的示例。
If you stick with submodules, note that a submodule can automatically follow a branch . 如果您坚持使用子模块,请注意, 子模块可以自动跟随branch 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.