This can easily be done with two branches. I'm not sure why you say that βcode is modified by one, cannot easily and selectively merge with another,β because merging is pretty easy in Git.
The structure that I would suggest is to have a branch for your general version and a branch for your personal version. Mergers should take place in only one direction, from a common branch to a personal branch. This means that any changes you make to the general version are included in the personal version.
In other words, this is normal ...
git checkout personal git merge general
This should never be done ...
git checkout general git merge personal
If you make changes to your personal version and decide that it would be nice to have the same code in the general version, you should be able to handle this quite easily with the cherry pick. It takes a little forethought to organize commits in a personal thread. You will need a commit in a personal branch, which contains only those changes that you want to transfer to the general version, and then just cherry select it from the personal branch and lower it to the general branch.
Two repositories can do the same thing. This will reduce the risk of accidentally uploading your personal version to Github, but it would make it more tedious to work with two different versions.
Personally, I would go with two branches in the same repo.
source share