- Git for the FCC software
This page should allow new Git users to get started with the FCC software, and describes the workflow for accessing and contributing FCC code.
For a general introduction to git, have a look at these tutorials:
See the corresponding github help-page
You will be using (at least) 3 versions of the FCCSW repository:
- The official FCCSW on github
- Your fork of FCCSW on github (see github help on what that means)
- Your local repository copy in your work area (e.g. on AFS)
The repositories 1 and 2 are added as remote to the repository 3:
git clone [email protected]:[YOUR_GITHUB_USER]/FCCSW.git
cd FCCSW
git remote add hep-fcc [email protected]:HEP-FCC/FCCSW.git
To get new code, do the following in 3
-
fetch information from 1
git fetch hep-fcc
-
merge the master branch from 1 into your development area do
git merge hep-fcc/master
-
push your local changes to 2 (see below how to create a local branch)
git push origin [NAME_OF_LOCAL_BRANCH]
To contribute new code, do the following:
-
develop your feature in 3 on a local branch of your choice, to create a branch do:
git branch -b [NAME_OF_LOCAL_BRANCH]
-
get new code from 1 as explained above and merge it in this branch
-
test:
- that the code compiles and all tests succeed (
make; make test
) - that your code runs
- that it produces the expected results
- add tests for your code
- that the code compiles and all tests succeed (
-
push your local branch to 2 (see above)
-
create a pull request from 2 to 1 (see github help-page )
Please always follow the recommendations below:
-
feel free to commit often to your local repository, but do not create pull request for small incremental changes
-
if you're working on a given topic, always create a branch for it, e.g. pythia_interface. You may commit many times to this branch in your local repository. When you have something solid create a pull request to the official FCCSW repository.
-
always provide a meaningful comment for each commit
-
commit comments should look like the one below, so that they show up correctly in git printouts.
first version of a pythia interface # this line should be a short 1 liner Here, you may write a few more lines if needed
In case you have any question on this tutorial, or need help to sort out
an issue with a repository, Feel free to drop a mail to
fcc-experiments-sw-dev at CERN, and we'll be happy to help you
!