2

I have two repositories for two websites, but those two websites share the same framework.

I wanted to make a dedicated repository for the framework itself but I'm not sure how would that work.

What I currently do is that I develop the framework within website1 and then copy it to website2 each time I add new features. As you can see it's not very effective...

I would like a separate repository for the framework, but I still need it to be within one of the two websites so I can keep working on it. The most important part is that I need to be able to deploy it to the other website in a simple way

What is the best solution for me? How can this be achieved?

PS: I'm using SourceTree with Bitbucket quit intensively for the past months so I'm fairly familiar with git, but I have never used the command line.

4

2 回答 2

2

只要您的框架仅限于您网站的子目录,那么可以,您可以将您的框架视为您的网站存储库的子模块,它充当“父”存储库。

SourceTree 支持子模块(从 1.3 开始),如果您的框架在其自己的存储库中进行管理,您可以将其添加到您的网站存储库中。
请参阅“使用子模块和子存储库

在 SourceTree 中添加子模块

于 2013-08-26T06:24:52.580 回答
0

由于您没有提到您正在使用什么语言和框架,在一般用例中,建议为您的框架创建一个 git 存储库并将其用作两个项目的子模块。

节省“复制粘贴”的时间,并使您的框架的提交远离特定于站点的提交,因此您的提交日志将更清晰,并且可以允许其他人为您的框架做出贡献,并可能允许开源您的框架的能力。

于 2013-08-26T05:44:09.293 回答