-
Notifications
You must be signed in to change notification settings - Fork 560
GitHub repositories
tomkraljevic edited this page Dec 4, 2013
·
6 revisions
Each private repository should be created as a duplicate of public repository. See: https://help.github.com/articles/duplicating-a-repository
Lets say the customer is called jahoda then the repository should be called h2o.jahoda.
git clone --bare git://github.com/0xdata/h2o.git
cd h2o
git push --mirror git@github.com:0xdata/h2o.jahoda.git
--mirror parameters makes a new repository as a duplicate of the original repository
Each private repository contains a master branch and customer branch called jahoda. The master branch contains the mirror of public master branch, customer branch contains customer specific code.
# create a new local repository
git checkout -b jahoda
# ... make customer changes ...
# and push changes into a new remote branch
git push origin jahoda
- add read-only remote (read-only because of used URL kind) called public
git remote add public git://github.com/0xdata/h2o.git
To list remotes use git remote -v
, to inspect a remote use git remote show origin
- fetch all changes from public remote
git fetch public
- merge incoming changes from public repository into master of customer repository
git checkout master
git merge public/master
git push
- OPTIONAL merge changes in master into customer branch jahoda
git checkout jahoda
git merge master
- Think about that - this step is DANGEROUS since you can introduce a code which is customer-specific into public branch !!!!
- Think again !!!
- Find a commit which you want to back-port and find its hash
- Cherry pick a commit into master at customer repository. Cherry-pick directly commit the change, if you want to avoid commit use
-n
option
git checkout master
git cherry-pick deadbabe0101
- Push change into public h2o master. This will not work, since above we used read-only URL of public H2O repository (the skilled user knows how to edit
.git/config
and change it :)
git push public master
- edit .project and change
<name>h2o</name>
to<name>h2o.jahoda</name>
- separate all new customer sourcec into src-custom - it should symplify change tracking
- ?more?