Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

6.1 Github workflow and contribution guide

Overview

This page should allow users that are new to Git 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:

First time setup of git

Please refer to this tutorial and the GitHub help.

Generate and set up ssh keys for github

When working on lxplus we recommend to clone github repositories via SSH, especially if you want to contribute code. For this to work, you need to generate ssh keys for authentication. See the corresponding github help-page.

Improving your git experience

It may be useful to install Git integration tools for your shell that allow tab-completion of most git commands and also can show you in your prompt on which branch you currently are, what changes you have pending, etc.

Development workflow

You will be using (at least) 3 versions of the FCCSW repository:

  1. The official FCCSW on github

  2. Your fork of FCCSW on github (see github help on what that means)

  3. 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 git@github.com:[YOUR_GITHUB_USER]/FCCSW.git # create a local copy (3) of your fork (2)
cd FCCSW
git remote add hep-fcc git@github.com:HEP-FCC/FCCSW.git # add official repo (1) as additional remote

Keeping your local repository up to date

Contributing code

Recommendations

Please always follow the recommendations below.

General recommendations

Commit comments

Cleaning history

Pull requests

Trouble-shooting

When I try to push to the repository, I get an authentication error

Check with git remote -v which remote repositories you have added to your local copy. You should see something like:

hep-fcc	git@github.com:HEP-FCC/FCCSW.git (fetch)
hep-fcc	git@github.com:HEP-FCC/FCCSW.git (push)
origin	git@github.com:[your git user name]/FCCSW.git (fetch)
origin	git@github.com:[your git user name]/FCCSW.git (push)

If you see something similar but all the addresses start with https, see below.

If you only see origin git@github.com:HEP-FCC/FCCSW.git, you need to add your own repository, push to that one and do a pull request, as described above. To add your own repository do:

git remote rename origin hep-fcc
git remote add myfccsw git@github.com:[your git user name]/FCCSW.git

I have cloned with https and now I can’t push my changes, what do I do?

You only need to change the URL of your remote pointing to your repository to one that uses SSH instead:

git remote set-url [the remote name] git@github.com:[your git user name]/FCCSW.git

Now you can push to that remote with:

git push [the remote name] [the branch you want to push]

Need help?

In case you have any questions on this guide, 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. Alternatively create an issue in the bug tracker smile