Path 1 - Constant rebase
Suppose there are 3 branches:
master for publicboo for privatebaar for private
Something like that:

You developed something on the master branch, then reinstall the foo and baar branch on master. You need (1) Place an order foo , (2) Restore foo to master , (3) Place an order baar , (4) Restore baar to master, then it will be as follows:

Note : repeat these steps over and over.
Method 2 - Merge
Assume the same 3 branches.
Checkout foo and merge master into foo :

Do something on the baar branch, and finally you get:

After you have developed some of the master, complete these steps again and get:

Path 3 - Submodule
The above two methods are a little dangerous if you push all the branches to the remote one. This method is more complicated, you need to know how to use the submodule, but I like it more. :)
(1) Prepare a data repo for a private database, you can check the branch between foo / baar .


(2) Prepare another regular / simple repo as a container, something like this:


(3) Then add this repo as a submodule to this repo:

You will receive them after committing:


(4) Again, add a public repo named test here as a submodule:


Currently, you can develop test repo in this repo and check any branch of the data repo on the other side.
Note 1 : You must configure the path correctly.
Note 2 : if you do not like the submodule, you can just use the folder as a container and then put two repos in it.
Method 4 - Merge Without Fixation or Squash
As this answer (by @Royal Pinto) said, I am showing the TortoiseGit operation here.


Note: personal data has been placed in the index file. For the next commit command to pass it to the repo.