Best practices for git repositories on open source projects

后端 未结 1 1318
刺人心
刺人心 2021-01-29 22:58

I\'m contributing to a fairly small open source project hosted on Github. So that other people can take advantage of my work, I\'ve created my own fork on Github. Despite Github

相关标签:
1条回答
  • 2021-01-29 23:34

    Some tips I've learned from a similar situation:

    • Have a remote tracking branch for the upstream author's work.
    • Pull changes from this tracking branch into your master branch every so often.
    • Create a new branch for each of the topics you're working on. These branches should generally be local only. When you get changes from upstream into master, rebase your topic branches to reflect these changes.
    • When you're done with some topic work, merge into master. This way, people who are deriving work from yours, will not see too much rewritten history, since the rebasing occurred in your local topic branches.
    • Submitting changes: Your master branch will basically be a series of commits, some of which are the same as upstream, the rest are yours. The latter can be sent as patches if you want to.

    Of course, your choice of branch names and remotes are your own. I'm not sure these are exhaustive to the scenario, but they cover most of my hurdles.

    0 讨论(0)
提交回复
热议问题