This gist describes how to create private branch (downstream) of a public repository (upstream).
$ git init private-repo
$ cd private-repo
$ git remote add upstream [email protected]:<username>/public-repo.git
$ git remote add origin [email protected]:<username>/private-repo.git
$ git remote --verbose
$ git commit --allow-empty --message "Initial commit"
$ git push --set-upstream origin main
$ git checkout -b develop
$ git push --set-upstream origin develop
$ git branch --all
$ git fetch upstream main
$ git merge --allow-unrelated-histories upstream/main
$ git push
# Do some changes...
$ git add .
$ git commit -m "Some changes"
$ git push
$ git fetch upstream main
$ git log --all --graph --oneline
$ git merge upstream/main
$ git push
$ git switch main
$ git merge develop
$ git push
$ git log --all --graph --oneline
For next clones:
$ git clone [email protected]:<username>/private-repo.git
$ cd private-repo
$ git remote add upstream [email protected]:<username>/public-repo.git
$ git remote --verbose
$ git switch develop
$ git fetch upstream main
$ git log --all --graph --oneline
$ git merge upstream/main