How to keep public and private versions of a git repo in sync?

前端 未结 2 620
你的背包
你的背包 2020-12-01 02:16

I\'m releasing an open-source Rails app on Github (probably MIT license). I also want to maintain a private branch/fork of the project that we will use as part of a pay serv

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 02:47

    If the code regarding the "part of a pay service" is separate (i.e. "in another directory") than the code representing the "open-source Rails app" pushed to public repository, you could:

    • defined the public part as an independent repository (that you can push whenever you need to)
    • defined the private part as another independent repository
    • use submodules to include your public part within your private repository

    That way, you are working with the all system (public Rails app + private pay system), but only push the public part to GitHub, and you can push the all system (private + public) to another private repository (on a backup machine for instance).


    If the private code is mixed with the public one... then see Talljoe's answer or Jakub Narębski's answer.

提交回复
热议问题