-
Notifications
You must be signed in to change notification settings - Fork 23
Home
Some steps may not be necessary if the repositories already exist:
-
Create public repository on gitHub under the organization stochasticHydroTools.
-
Create private repository on gitHub under the organization stochasticHydroTools. We can use the name convection "public_repository_name-private".
-
Clone public repository to your machine, e.g.,
git clone git@github.com:stochasticHydroTools/RigidMultiblobsWall.git
-
Add private repo to the local copy, e.g.
git remote add private git@github.com:stochasticHydroTools/RigidMultiblobsWall-private.git
This allows us to push changes to the public and the private repository.
-
Create a branch "next" from the master branch in the public repository and push to the private repo. We can use next like the stable private branch and merge all
the private changes there. Use the commands:git checkout master
git checkout -b next
git push -u private next
note that we are pushing to the private repo with
-u private
.
Some steps may not be necessary:
-
Clone public repository, e.g.
git clone git@github.com:stochasticHydroTools/RigidMultiblobsWall.git
-
Add private repo to the local copy, e.g.
git remote add private git@github.com:stochasticHydroTools/RigidMultiblobsWall-private.git
-
Checkout branch "next" from the private repo
git checkout next
-
Create developing branch and push to the private repo
git checkout -b dev
git push -u private dev
note that we are pushing to the private repo with
-u private
. -
Merge dev branch to next. DO NOT MERGE WITH MASTER, this way we keep things private.
git checkout next
git merge dev
Solve merging conflicts, commit and then push changes:
git push private next
-
To make private features public merge branch next with master and push to the public repository. Use the flag
--squash
to keep the private history hidden from
the public repository.git checkout master
git merge --squash next
Solve merging conflicts, commit and push
git push origin master
Of course, we can still create public branches, e.g.
git checkout -b dev-public
git push -u origin dev-public
Note that "origin" is the default name of git repositories, in our case it is the public repository, and merges can be done between any two branches public or p
rivate not just next and master.