为项目骨架创建一个 git 存储库
我创建了一个 自定义项目框架 作为我的 django 项目的开始,托管在公共存储库上github。
我想使用它作为我的新的公共和私人项目的根文件夹,该项目也托管于@github。
问题是我不能使用这个作为子模块,因为我知道我不能在同一个 git 存储库中的另一个子模块中添加子模块。就我而言,我想在骨架文件夹中添加子模块。
作为练习,对于公共项目 B,我刚刚创建了骨架的一个分支,但似乎很棘手,因为我的项目 B 代码托管在单独分支上的骨架存储库内。
你会如何在 GIT 中做到这一点?
另外,github上有什么关于如何像公共存储库一样创建“私有分支”的技巧吗?
谢谢:)
朱利安
I created a custom project skeleton as a start for my django projects, hosted on a public repo at github.
Id like to use this as root folder for my new, public and privates projects, also hosted @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. 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.
How would you do this in GIT ?
Also, any trick at github on how to create 'private branches' like from public repos ?
Thanks :)
Julien
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经成功创建了 git 存储库,其子模块是同一存储库中的分支。不过,我还没有尝试过使用子子模块。为了避免子模块,只需为您的“原型”指定一个分支。每当你需要这个头的新项目分支时。
PS:如果你想在github上建立一个私人分支,你需要成为付费会员。如果你想要便宜的私人分支,就不要将它们上传到 github。
I've successfully created git repos whose submodules were branches in the same 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. If you want private branches for cheap, just don't upload them to 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