Лучшая практика для управления вариантами проекта в Git?

Мне нужно разработать два проекта Django, которые разделяют 90% одного и того же кода, но имеют некоторые вариации в нескольких приложениях, шаблонах и в самой модели.

Я использую Git для распределенного управления исходным кодом.

Мои требования таковы:

common code for both projects is developed in one place (Project1's development environment)

periodically this is merged into the development environment of the second project (Project2)

the variations are not easily encapsulated within apps. (eg. there are apps. such as "profiles" which vary between Project1 and Project2 but for which there's also an ongoing common evolution)

both Project1 and Project2 have public repositories, so that I can collaborate with others

similarly Project1 and Project2 ought to have development, demo, staging and production servers.

however, the public repository is not on the same server in both cases. So, for example, when I'm developing in Project1, I want to be able to "push" to my github server, but not have Project2 stuff going there.

there are files such as local_settings.py which are completely different between Project1 and Project2, but should be shared between multiple developers of each Project

Так каков наилучший способ справиться с этой ситуацией?

То, что казалось бы идеальным, было бы что-то вроде «отфильтрованной тяги» где вместо слова .gitignore «полностью игнорировать этот файл» я могу сказать «игнорировать этот файл при извлечении из этого репозитория»; Я не смог увидеть ничего подобного в документации, но может быть что-то подобное?

Ответы на вопрос(5)

Ваш ответ на вопрос