TWiki> TOTEM Web>CompGIT (revision 5)EditAttachPDF

TOTEM GIT repositories

GIT is a distributed revision control and source code management system. It gains more popularity over SVN and CSV.


Web Tools

  • CERN GITLAB - here you can create and manage GIT repositories


The access to git repository is described here

GIT commands

The basic commands are similar to SVN:

GITSorted ascending Subversion
git commit svn commit

Follow this tutorial to learn about differences between GIT and SVN.


How to fetch convert SVN repository to GIT repository ?

Read following tutorial

How to fetch TOTEM offline code from GIT repository ?

The project is available on gitlab -

Clone the repository, using preferred auth method:

* https (password required on each operation):

git clone
* ssh (need to have .ssh/id_rsa private key generated and public key uploaded to
git clone ssh://
* kerberos
git clone

Checkout the desired branch:

cd totem-offline
git checkout release/8.0.X 

Branch structure

Branches starting from release/ are production branches. At the moment totem-offline software contains 3 releases:

Each of them contains file (presented on listed websites) describing its contents, environment setup and working configurations.

Users may create private branches that should start with prefix 'feature/' or 'bugfix/', depending on the type of changes. Their names should be descriptive, and once the development is finish, private branch may be merged into release and deleted.

Sample names:

  • feature/add-new-reco-configuration-files
  • bugfix/fix-wrong-alignment

Basic workflow

Suppose we need to modify 'TotemAlignment/RPData/alignment.xml' file in order to correct something in release 8.0.X:

Go to git repository, checkout the branch that we want to change and pull all remote changes:

git checkout release/8.0.X
git pull

Create local and remote bugfix branch:

git branch bugfix/fix-wrong-alignment
git checkout bugfix/fix-wrong-alignment
git push --set-upstream origin bugfix/fix-wrong-alignment

Do the changes:

# modify files
# check the changes with 'git status' or 'git diff'
git add TotemAlignment/RPData/alignment.xml # stage modified file for commit, alternatively stage all files with 'git add --all .'

Commit and push the changes:

git commit # this commands asks for commit message, the files get committed to local branch
# you may check 'git log' now
git push # push all the commits to remote branch

If we have verified that the code is working in our bugfix branch, we may open a merge request to the appropriate release.

All can be done on: After creation, the changes should be reviewed. When they got accepted, the code will be merged automatically if no conflicts occurred (if they weren't any other modifications of the same files in the meantime). Otherwise, conflicts must be resolved manually as described on the merge request website.

Usefull commands

Reset current repository to remote branch, deleting all local and unpushed changes:

git fetch # get the repository up to date
git reset --hard origin/release/8.0.X # reset to remote branch
git checkout release/8.0.X # checkout local branch
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r5 - 2016-03-04 - TomaszJanLichon
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    TOTEM All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback