Welcome to the Github Community Forum!
If i’m not missunderstanding you can create a new remote repository in your local repository, with this you can push two times instead of copy and paste the code to the other local repository and push to the remote private repository.
To do this you need the remote command of git -> git-remote-docs
You have the remote repository and the local one. Now you want to add a new remote repository:
git remote add <name_of_new_remote> <link_of_remote>
if i called the new remote origin_private and the link is something like this https://github.com/user/private_repository.git:
git remote add origin_private https://github.com/user/private_repository.git
this command will create this history:
With this you can push changes in both repository with two push in sequence:
git push origin_public master
git push origin_private master
Or you can create a hook when you push to one of origin with hooks -> Git-Hooks with this feature you can create a pre-push hooks that do the other push, but i strongly dont reccomend it for many reasons.
Hope to solve your problem
Mark helpfull posts with Accept as Solution to help other users locate important info. Don’t forget to give Kudos for great contents!