Git 子模块拉取请求工作流程

发布于 2024-11-05 11:36:31 字数 509 浏览 0 评论 0原文

我对一些最佳实践很好奇。

我想将一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鸵鸟症 2024-11-12 11:36:31

当您想要进行更改时,请从 slim 创建一个 feature 分支来进行开发。然后,当您想要贡献它时,运行:

git rebase --onto master slim feature

这将使它看起来像 feature 是直接从 master 分支的,而不需要在 slim 中进行任何删除。

When you want to make a change, create a feature branch from slim to do your development. Then when you want to contribute it, run:

git rebase --onto master slim feature

That will make it look like feature was branched directly from master without any of your deletions in slim.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文