I wish to publish a Git repository's master
branch (containing simulation codes for an accepted peer-reviewed paper) but not disclose work that has been done on separate branches as part of ongoing research. Eventually, that work will be published (at which point I would merge it to master
).
I'm fairly sure this can be accomplished by following these steps:
- create a new repo,
- locally set up the private original repo as a remote, say
secret
, git pull secret master
,- set up the
origin
remote that is publicly available, git push -u origin master
However, I have heard one too many horror stories about clear-text passwords that turned up in public Git repos etc. and seek confirmation from someone who actually understands the inner workings of Git that the information from the other branches is indeed not contained in the public repo.
In case that's relevant (though I don't think it is), the public Git repo will be hosted on either Github or our university's Gitlab instance.