Contributing to CTK: Difference between revisions
From Commontk
Jump to navigationJump to search
Line 36: | Line 36: | ||
* Then, from the branch ''new_feature'', you could just enter the following to backup/publish your work: | * Then, from the branch ''new_feature'', you could just enter the following to backup/publish your work: | ||
git push | git push | ||
* To delete a branch from your fork: | |||
git push origin :new_feature | |||
= Checkout a branch from a different fork = | = Checkout a branch from a different fork = |
Revision as of 14:23, 13 July 2010
Home < Contributing to CTKThe present document aims at describing how a developer should contribute to CTK.
- The source code of CTK is currently hosted on Github [1]. See http://github.com/commonth/CTK
- It's also assumed the developer is familiar with git. There are countless amount of resources available online. A good start point could the list presented on CMake/git page [2].
- We use a topic-based workflow as documented here and thus define integration branches:
- master Release preparation; starting point for new features (default)
- next Development; new features published here first
PreRequisites
- Create an account on github.com
- Fork http://github.com/commontk/CTK
- Introduce yourself
$ git config --global user.name "Your Name" $ git config --global user.email "you@yourdomain.com"
Checkout your fork
cd MyProject git clone git@github.com:<MYACCOUNT>/CTK.git git remote add origin git@github.com:<MYACCOUNT>/CTK.git git remote add upstream git@github.com/commontk/CTK.git
Publishing your branch
- Having your own fork CTK allows you to backup and publish your work avoiding the hurge to merge [3]
git checkout -b new_feature hack, hack, hack, add, commit git push origin topic1:refs/heads/topic1
- As a shortcut, you could also enter the following. Some useful script are also available here:
git config branch.topic1.remote origin git config branch.topic1.merge refs/heads/topic1
- Then, from the branch new_feature, you could just enter the following to backup/publish your work:
git push
- To delete a branch from your fork:
git push origin :new_feature
Checkout a branch from a different fork
- You may want to collaborate with an other developer and work conjointly on a feature.
- Let's say, jcfr published the branch awesome_feature on his fork. You should do the following to check out his branch:
git remote add jcfr git://github.com/jcfr/CTK.git git fetch jcfr git checkout -b awesome_feature refs/remotes/jcfr/awesome_feature
- You should now have a local branch named awesome_feature. You can now add, commit and publish your work.