简体   繁体   English

为项目框架创建一个git仓库

[英]create a git repo for project skeleton

I created a custom project skeleton as a start for my django projects, hosted on a public repo at github. 我创建了一个自定义项目框架作为我的django项目的开始,托管在github上的公共仓库。

Id like to use this as root folder for my new, public and privates projects, also hosted @github. 我喜欢将它作为我的新公共和私有项目的根文件夹,也是托管@github。

The problem is i cannot use this one as a submodule because as fas ar i know i cannot add submodules inside another submodules in the same git repo. 问题是我不能将这个用作子模块,因为我知道我不能在同一个git仓库中的另一个子模块中添加子模块。 and in my case i want to add submodules inside the skeleton folder. 在我的情况下,我想在骨架文件夹中添加子模块。

As exercice, for a public projectB, i just created a branch of my skeleton but seems tricky as my projectB code is hosted inside the skeleton repo on a separate branch. 作为exercice,对于一个公共项目B,我刚刚创建了我的骨架的一个分支但是看起来很棘手,因为我的projectB代码托管在一个单独的分支上的骨架仓库中。

How would you do this in GIT ? 你会如何在GIT中做到这一点?

Also, any trick at github on how to create 'private branches' like from public repos ? 另外,在github上如何通过公共回购创建“私人分支”的任何技巧?

Thanks :) 谢谢 :)

Julien 朱利安

I've successfully created git repos whose submodules were branches in the same repo. 我已经成功创建了git repos,其子模块是同一个repo中的分支。 I haven't tried this with sub-submodules though. 我没有尝试使用子子模块。 To avoid sub-submodules, just dedicate a branch for your "prototype". 为了避免子子模块,只需为您的“原型”专门设置一个分支。 Whenever you need a new project branch from this head. 每当你需要一个新的项目分支从这个头。

PS: if you want a private branch on github, you need to become paying member. PS:如果你想在github上有一个私人分支,你需要成为付费会员。 If you want private branches for cheap, just don't upload them to github. 如果你想要廉价的私人分支,只是不要上传到github。

I finally decided to have seperate public branches as skeletons then use private submodules to host private code. 我最终决定将单独的公共分支作为骨架,然后使用私有子模块来托管私有代码。

this solution looks powerful and secure enough for me. 这个解决方案对我来说足够强大和安全。

thanks for suggestions 谢谢你的建议

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM