我可以将两个不同版本的cakephp放入同一个Git仓库吗?有不同的Git分支?

时间:2022-09-19 15:08:56

I have a project in CakePHP 1.3 in a GitHub repo.

我在GitHub仓库中的CakePHP 1.3中有一个项目。

I want CakePHP 1.3 migrate to 2.x version of CakePHP. Can I work with Git branches?

我希望CakePHP 1.3迁移到CakePHP的2.x版本。我可以和Git分支机构合作吗?

Will creating a new branch here for CakePHP 2.x work? I mean, alongside the CakePHP 1.3 master branch already there?

将在CakePHP 2.x工作中创建一个新分支吗?我的意思是,除了CakePHP 1.3主分支已经存在吗?

2 个解决方案

#1


2  

Yep.

是的。

That's for branching is for, working on different things side by side (parallel). Crate branch for each version you develop.

分支的意思是,并行处理不同的事情(并行)。您开发的每个版本的Crate分支。

#2


0  

Create two branches and make sure you use CakePHP as a git submodule or you'll bloat the repository. Then just checkout a different version of the submodule in each branch and you are done.

创建两个分支,并确保使用CakePHP作为git子模块,否则你将膨胀存储库。然后只需在每个分支中签出不同版本的子模块即可完成。

Another, IMO better way to manage this is composer. Just define the version in your composer.json you want update and commit it.

另一个,IMO更好的管理方法是作曲家。只需在您想要更新的composer.json中定义版​​本并提交它。

#1


2  

Yep.

是的。

That's for branching is for, working on different things side by side (parallel). Crate branch for each version you develop.

分支的意思是,并行处理不同的事情(并行)。您开发的每个版本的Crate分支。

#2


0  

Create two branches and make sure you use CakePHP as a git submodule or you'll bloat the repository. Then just checkout a different version of the submodule in each branch and you are done.

创建两个分支,并确保使用CakePHP作为git子模块,否则你将膨胀存储库。然后只需在每个分支中签出不同版本的子模块即可完成。

Another, IMO better way to manage this is composer. Just define the version in your composer.json you want update and commit it.

另一个,IMO更好的管理方法是作曲家。只需在您想要更新的composer.json中定义版​​本并提交它。