TWiki
>
TOTEM Web
>
CompGIT
(2016-03-10,
TomaszJanLichon
)
(raw view)
E
dit
A
ttach
P
DF
---+ TOTEM GIT repositories GIT is a distributed revision control and source code management system. It [[http://www.google.com/trends/explore#cat=0-5&q=/m/05vqwg,+/m/012ct9,+/m/09d6g&cmpt=q][gains more popularity]] over SVN and CSV. ---++ Documentation * [[http://information-technology.web.cern.ch/services/git-service/][GIT Service main webpage]] * [[https://cern.service-now.com/service-portal/faq.do?se=git-service][CERN Knowledge base - GIT (internal only)]] ---+++ Web Tools * [[https://gitlab.cern.ch/][CERN GITLAB]] - here you can create and manage GIT repositories ---++ Access The access to git repository is described [[CompGITPermission][here]] ---++ GIT commands The basic commands are similar to SVN: | *GIT* | *Subversion* | | git commit | svn commit | Follow [[http://aliceinfo.cern.ch/Offline/node/2912/][this tutorial]] to learn about differences between GIT and SVN. ---++ HOWTO ---+++ How to fetch convert SVN repository to GIT repository ? Read following [[CompSVN2GIT][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): <verbatim> git clone https://gitlab.cern.ch/totem/totem-offline.git </verbatim> * ssh (need to have .ssh/id_rsa private key generated and public key uploaded to https://gitlab.cern.ch/profile/keys) <verbatim> git clone ssh://git@gitlab.cern.ch:7999/totem/totem-offline.git </verbatim> * kerberos <verbatim> git clone https://:@gitlab.cern.ch:8443/totem/totem-offline.git </verbatim> Checkout the desired branch: <verbatim> cd totem-offline git checkout release/8.0.X </verbatim> ---+++ Branch structure Branches starting from release/ are production branches. At the moment totem-offline software contains 3 releases: * [[https://gitlab.cern.ch/totem/totem-offline/tree/release/7.0.4][7.0.4]] * [[https://gitlab.cern.ch/totem/totem-offline/tree/release/7.5.0][7.5.0]] * [[https://gitlab.cern.ch/totem/totem-offline/tree/release/8.0.X][8.0.X]] 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 For an usual development we should checkout the release branch and synchronize with remote: <verbatim> git checkout release/8.0.X git pull </verbatim> Do the changes: <verbatim> # modify files # check the changes with 'git status' or 'git diff' git add <modified_file_path> # stage modified file for commit, alternatively stage all files with 'git add --all .' </verbatim> Commit the changes: <verbatim> git commit # this commands asks for commit message, the files get committed to local branch # you may check 'git log' now </verbatim> Once the changes are satisfactory, we may decide to make our commits public by pushing them to remote branch <verbatim> git push # push all the commits to remote branch </verbatim> From now on they will be visible to everyone and will appear in others' people local branches after executing "git pull". ---+++ Bigger changes When working on bigger task, which can't be done during one day and needs to be integrated into code as a whole, it's recommended to create a dedicated branch. Therefore instead of woking on release branch directly, we create a bugfix or feature branch (depending on the nature of changes) using commands: <verbatim> git branch bugfix/fix-wrong-alignment git checkout bugfix/fix-wrong-alignment git push --set-upstream origin bugfix/fix-wrong-alignment </verbatim> The development process is similar, we can commit and push changes to the branch. If we have verified that the code is working in our branch, we may open a merge request to the appropriate release, so the code would be included into it. All can be done on: https://gitlab.cern.ch/totem/totem-offline/merge_requests. After creation, the changes should be reviewed (either by creator or someone else). 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. Such approach has an advantage that we can see exactly what has been developed and what is going into release, so it is possible to spot missing or excess elements and do the necessary cleaning. ---+++ Usefull commands Reset current repository to remote branch, deleting all local and unpushed changes: <verbatim> 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 </verbatim>
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r6
<
r5
<
r4
<
r3
<
r2
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r6 - 2016-03-10
-
TomaszJanLichon
Log In
TOTEM
TOTEM
TOTEM home
TOTEM TWiki
TOTEM TWiki
DETECTOR
SOFTWARE
Offline Software
Monitor
TotemDQM
Trigger/DAQ
DCS
ANALYSIS
PHYSICS
DOCUMENTATION
Service links
Changes
Index
Search
About
Rules and conventions
Playground
TWiki help
TWiki formatting rules
Create personal sidebar
Cern Search
TWiki Search
Google Search
TOTEM
All webs
Copyright &© 2008-2021 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