-
Notifications
You must be signed in to change notification settings - Fork 28
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 [email protected]:stochasticHydroTools/RigidMultiblobsWall.git -
Add private repo to the local copy, e.g.
git remote add private [email protected]:stochasticHydroTools/RigidMultiblobsWall-private.gitThis 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 mastergit checkout -b nextgit push -u private nextnote that we are pushing to the private repo with
-u private.
Some steps may not be necessary:
-
Clone public repository, e.g.
git clone [email protected]:stochasticHydroTools/RigidMultiblobsWall.git -
Add private repo to the local copy, e.g.
git remote add private [email protected]: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 devgit push -u private devnote 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 nextgit merge devSolve 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
--squashto keep the private history hidden from
the public repository.git checkout mastergit merge --squash nextSolve merging conflicts, commit and push
git push origin masterOf course, we can still create public branches, e.g.
git checkout -b dev-publicgit push -u origin dev-publicNote 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.