12

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?

4

1 回答 1

11

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

git rebase --onto master slim feature

这将使它看起来像是feature直接从master没有任何删除的slim.

于 2011-05-06T01:12:51.190 回答