Git 子模块拉取请求工作流程
我对一些最佳实践很好奇。
我想将一个 git 存储库作为子模块包含在我的项目中。我还想为这个存储库做出贡献并提供拉取请求。我已经分叉了该存储库,并希望将我的分叉作为子模块添加到我的项目中。
我在我的 fork 中创建了一个新的 slim
分支,它从原始存储库主分支中删除了一些内容:例如示例文件、演示等。我特别想使用这个 slim
> 子模块的分支以保留多余的内容。
我已经成功完成了这个分支和子模块策略。然而,我现在想知道拉取请求和对该项目的贡献。
理想情况下,我想编辑子模块作为我的项目的一部分,并将提交推送到子模块 slim
分支。然后,我想将 slim
分支中的更改合并回 master
中,以便我可以执行拉取请求。
但是,我不希望将 slim
分支上的初始删除提交合并回 master 中。我可以通过哪些方式为项目做出贡献,而不会弄乱我的一些删除提交?
I am curious about some best practices.
There is a git repo that I would like to include as a submodule in my project. I would also like to contribute to this repo and offer pull requests. I have forked the repo and would like to add my fork as the submodule to my project.
I have made a new slim
branch in my fork that removes some stuff from the original repo master branch: e.g. example files, demos, etc. I would specifically like to use this slim
branch for the submodule to keep the extra stuff out.
I have successfully done this branching and submodule strategy. However I am now wondering about pull requests and contributions to the project.
Ideally I would like to edit the submodule as part of my project, and push commits to the submodules slim
branch. I would then like to merge the changes in slim
branch back into master
so that I can do a pull request.
However I do not want my initial delete commit on the slim
branch to be merged back into master. What are some ways I can contribute back to the project with out messing in some of my delete commits?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您想要进行更改时,请从
slim
创建一个feature
分支来进行开发。然后,当您想要贡献它时,运行:这将使它看起来像
feature
是直接从master
分支的,而不需要在slim
中进行任何删除。When you want to make a change, create a
feature
branch fromslim
to do your development. Then when you want to contribute it, run:That will make it look like
feature
was branched directly frommaster
without any of your deletions inslim
.