We currently have a public vplanet
repo and a private vplanet-private
repo. Here's what we decided our workflow should look like:
All development is done on the (non-master
) branches of vplanet-private
and synced to master
via pull requests. When a change is ready to be incorporated into the current released version of the code, we go to our local clone of the public vplanet
repository and pull from master
on vplanet-private
to local dev
. Then, on the GitHub UI, we issue a pull request for master
on vplanet
.
1. Clone both repos:
git clone https://github.com/VirtualPlanetaryLaboratory/vplanet.git
git clone https://github.com/VirtualPlanetaryLaboratory/vplanet-private.git
2. Add a remote to vplanet
called private
. This is how we will pull from the private repo.
cd vplanet
git remote add private https://github.com/VirtualPlanetaryLaboratory/vplanet-private.git
git config --global merge.ours.driver true
3. Add a remote to vplanet-private
called public
. This is how we will pull from the public repo.
cd ../vplanet-private
git remote add public https://github.com/VirtualPlanetaryLaboratory/vplanet.git
git config --global merge.ours.driver true
1. Say you've made some changes on the private repo and you're ready to push them over to the public repo. Since the repos aren't forks of each other, we can't issue the pull request directly on the GitHub UI. Instead, we do this locally, by pulling from the private repo to the public dev
branch, then push it to GitHub:
cd vplanet
git checkout dev
git pull private master
git push origin dev
2. We can now create a pull request from dev
to master
via the GitHub UI:
1. Now say someone has issued a pull request for dev
on vplanet
(the public repo). Once that pull request is accepted, let's go into the private repo and pull over the changes to the dev
branch on vplanet-private
:
cd vplanet-private
git checkout dev
git pull public dev
git push origin dev
2. We can now create a pull request from dev
to master
via the GitHub UI:
NOTE: Now that we're using Git LFS, things get a little tricky when pulling LFS files from the private repo to the public repo. This may be a bug in LFS or we may just be pushing it beyond what it's meant to do, but whenever I run
git pull private master
I get a bunch of errors saying[404] Object does not exist on the server
for every single LFS file. My current workaround is to copy the.git/lfs/objects
folder from the private repo to the public repo before runninggit pull private master
. Things work as expected in that case.EDIT: I decided to disable LFS for now.