TOTEM GIT repositories
GIT is a distributed revision control and source code management system. It
gains more popularity
over SVN and CSV.
Documentation
Web Tools
- CERN GITLAB
- here you can create and manage GIT repositories
Access
The access to git repository is described
here
GIT commands
The basic commands are similar to SVN:
Follow
this tutorial
to learn about differences between GIT and SVN.
HOWTO
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 -
https://gitlab.cern.ch/totem/totem-offline
.
Clone the repository, using preferred auth method:
* https (password required on each operation):
git clone https://gitlab.cern.ch/totem/totem-offline.git
* ssh (need to have .ssh/id_rsa private key generated and public key uploaded to
https://gitlab.cern.ch/profile/keys
)
git clone ssh://git@gitlab.cern.ch:7999/totem/totem-offline.git
* kerberos
git clone https://:@gitlab.cern.ch:8443/totem/totem-offline.git
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 README.md 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:
https://gitlab.cern.ch/totem/totem-offline/merge_requests
. 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