<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pct.wiki.uib.no/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mri083</id>
	<title>pCT - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://pct.wiki.uib.no/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mri083"/>
	<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/Special:Contributions/Mri083"/>
	<updated>2026-05-24T09:08:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=1013</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=1013"/>
		<updated>2024-02-08T09:31:11Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Undo revision 1011 by Mri083 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Wiki for the proton CT project&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Howto&#039;s ==&lt;br /&gt;
=== Software ===&lt;br /&gt;
* [[Documentation|Software Documentation]] on how to install and use the involved software packages, how to use the GitLab service, and about the development workflow, etc.&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
* [[Hardware Documentation and Howto&#039;s]] on pReadout, ALPIDE bonding, Production Test Box, Transition Card&lt;br /&gt;
&lt;br /&gt;
=== Control &amp;amp; Readout Software ===&lt;br /&gt;
* [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
=== ALPIDE ===&lt;br /&gt;
* [[ALPIDE Documentation and Papers]]&lt;br /&gt;
&lt;br /&gt;
=== Cooling ===&lt;br /&gt;
[[Cooling Documentation]] on the cooling simulations, measurements, laboratory setup and the final design. &lt;br /&gt;
&lt;br /&gt;
=== Århus Testbeam 2023 ===&lt;br /&gt;
[[Århus Testbeam 2023 Documentation]] on the testbeam at Århus hospital including simulation, setup, equipment used, etc. &lt;br /&gt;
&lt;br /&gt;
== [[Publications]] ==&lt;br /&gt;
List of publications from the project.&lt;br /&gt;
&lt;br /&gt;
==== Workpackage Reports ====&lt;br /&gt;
* [[Media:pCT-WP1-1-Rev2 design recommendations.pdf | pCT-WP1-01-Rev2 Detector design specifications]] (Rev2: Added carrier board thickness recommendations) --- See also submitted article on design optimization&lt;br /&gt;
* [[:File:pCT-WP1-02-Rev3 (Radiation environment and electronics).pdf | pCT-WP1-02-Rev3 Radiation environment and placement of electronics]] (Rev2: Updated results and assumptions, Rev3: Updated with 1-10cm results) (Please feel free to contact [mailto:jars@hvl.no Jarle Rambo Sølie] if there are any questions regarding the contents of this document.&lt;br /&gt;
&lt;br /&gt;
==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2770399 Alf Kristoffer Herland - MSc (HVL) - 2021 Development and implementation of data acquisition software for proton computed tomography.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3013935 Rune Almåsbakk - MSc (HVL) - 2022 Design and Implementation of Alignment software for a Digital Tracking Calorimeter used for proton CT.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3045481 Håvard Birkenes - MSc (UiB) - Design of a Configuration and Monitoring System for the Power Supply in the ProtonCT Project.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3076410 Alfred Abbasi - MSc (UiB) - 2023 Hardware and Software Studies for the Alignment of the Proton CT.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3072130 Jakub Bieniek - MSc (UiB) - 2023 Commisioning of the Cooling System for the Bergen Proton Computed Tomography Digital Tracking Calorimeter.]&lt;br /&gt;
&lt;br /&gt;
==== Journal Articles ====&lt;br /&gt;
* Aehle, M.,  et al. &amp;lt;b&amp;gt;Exploration of differentiability in a proton computed tomography simulation framework&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Physics in Medicine and Biology&amp;lt;/i&amp;gt;  2023;68(244002). &lt;br /&gt;
** UiB archive: [ http://hdl.handle.net/10852/106386 ]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ad0bdd doi:10.1088/1361-6560/ad0bdd]&lt;br /&gt;
&lt;br /&gt;
* Schilling, A.,  et al. &amp;lt;b&amp;gt;Towards Neural Charged Particle Tracking in Digital Tracking Calorimeters With Reinforcement Learning&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Physics in Medicine and Biology&amp;lt;/i&amp;gt;  2023;68(194001). &lt;br /&gt;
** UiB archive: [ https://hdl.handle.net/11250/3100524 ]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/acf5c2 doi:10.1109/TPAMI.2023.3305027]&amp;lt;/b&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Kortus, T.,  et al. &amp;lt;b&amp;gt;Towards Neural Charged Particle Tracking in Digital Tracking Calorimeters With Reinforcement Learning&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;IEEE Transactions on Pattern Analysis and Machine Intelligence&amp;lt;/i&amp;gt;  2023;45(15820). &lt;br /&gt;
** UiB archive: [ http://hdl.handle.net/10852/106386 ]&lt;br /&gt;
** IEEE link: [https://ieeexplore.ieee.org/document/10219056 doi:10.1088/1361-6560/acf5c2]&lt;br /&gt;
&lt;br /&gt;
* Alme, J., Barnaföldi, G.G., Barthel, R., Borshchov, V., Bodova, T., van den Brink, A., et al. &amp;lt;b&amp;gt;A High-Granularity Digital Tracking Calorimeter Optimized for Proton CT. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Frontiers in Physics.&amp;lt;/i&amp;gt;  2020;8(460). &lt;br /&gt;
** Published manuscript: [[Media:10.3389_fphy.2020.568243.pdf | PDF]]&lt;br /&gt;
** Frontiers link: [https://www.frontiersin.org/article/10.3389/fphy.2020.568243 doi:10.3389/fphy.2020.568243]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Volz, L., Sølie, J. R., Alme, J., Barnaföldi, G.G., Barthel, R. et al. &amp;lt;b&amp;gt;Helium Radiography with a Digital Tracking Calorimeter-a Monte Carlo Study for Secondary Track Rejection. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2021;66(3):035004. &lt;br /&gt;
** Published manuscript: [[Media: Pettersen_2021_Phys._Med._Biol._66_035004.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/abca03 doi:10.1088/1361-6560/abca03]&lt;br /&gt;
&lt;br /&gt;
* Sølie, J.R., Volz, L., Pettersen H.E.S., Piersimoni, P., Odland, O.H., Röhrich, D., et al. &amp;lt;b&amp;gt;Image quality of list-mode proton imaging without front trackers. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2020;65(13):135012. &lt;br /&gt;
** Published manuscript: [[Media: 10.1088_1361-6560_ab8.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ab8ddb doi:10.1088/1361-6560/ab8ddb]&lt;br /&gt;
&lt;br /&gt;
* Tambave, G., Alme, J., Barnaföldi, G.G., Barthel, R., Van Den Brink, A., Brons, S., et al.&amp;lt;b&amp;gt; Characterization of monolithic CMOS pixel sensor chip with ion beams for application in particle computed tomography. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Nuclear Instruments and Methods in Physics Research Section A&amp;lt;/i&amp;gt; 2020;958:162626. &lt;br /&gt;
** Published manuscript: [[Media: Tambave-2020-Characterization-of-monolithic-cm.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/pii/S0168900219311258?via%3Dihub doi:10.1016/j.nima.2019.162626]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Johan Alme, Gergely Gabor Barnafoldi, Alba Garcıa-Santos, Ola Grøttvik, Håvard Helstrup, Kristin Fanebust Hetland, Ilker Meric, Odd Harald Odland, Gabor Papp, Thomas Peitzmann, Dieter Röhrich, Joao Seco, Hesam Shafiee, Eivind Vågslid Skjæveland, Ganesh Tambave, Kjetil Ullaland, Monika Varga-Kofarago, Lennart Volz, Boris Wagner and Shiming Yang. &amp;lt;b&amp;gt;Design Optimization of a Pixel Based Range Telescope for Proton Computed Tomography.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Physica Medica Special Issue: Advances in Geant4 for medicine.&amp;lt;/i&amp;gt; 2019; 63:87-97&lt;br /&gt;
** Published manuscript: [[Media: Pettersen et al. - Design Optimization of a Pixel Based Range Telesco.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/abs/pii/S1120179719301358 doi:10.1016/J.ejmp.2019.05.026 ]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., J. Alme, A. van den Brink, M. Chaar, D. Fehlker, I. Meric, O.H. Odland, et al. &amp;lt;b&amp;gt;Proton Tracking in a High-Granularity Digital Tracking Calorimeter for Proton CT Purposes&amp;lt;/b&amp;gt;.  &amp;lt;i&amp;gt;Nuclear Instruments and Methods in Physics Research A 860C, 51–61. doi:10.1016/j.nima.2017.02.007.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: 1-s2.0-S0168900217301882-main.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0168900217301882 doi:10.1016/j.nima.2017.02.007]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1611.02031 arXiv:1611.02031]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Chaar, M., Meric, I., Odland, O.H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Accuracy of parameterized proton range models; a comparison&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Radiation Physics and Chemistry, 144 (C): 295-297 (2018). doi:10.1016/j.radphyschem.2017.08.02&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: Comparison of different calculation methods of proton ranges.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0969806X17303869?via%3Dihub 10.1016/j.radphyschem.2017.08.028]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1704.08854  arXiv:1704.08854]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H. E. S., and D. Röhrich. 2017. &amp;lt;b&amp;gt;Kreftbehandling Med Protonterapi Og Proton CT.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Fra Fysikkens Verden, December 2017.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published article: [[Media: FFV-proton-CT-ensidig.pdf | PDF]]&lt;br /&gt;
** [http://norskfysisk.no/filer/FFV/2017/FFV-2017-4.pdf Magazine at norskfysisk.no]&lt;br /&gt;
&lt;br /&gt;
==== Submitted ====&lt;br /&gt;
* Pettersen, H.E.S., Meric, I., Odland, O.H., Shafiee, H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Proton Tracking Algorithm for Pixel Based Range Telescopes for Proton Computed Tomography&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Revision submitted to Web of Conferences after the &amp;quot;Connecting the Dots&amp;quot; conference.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Revised manuscript: [[Media: detector-proton-tracking.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Lennart Volz, Jarle Sølie, Dieter Rohrich, and Joao Seco. &amp;lt;b&amp;gt;A Linear Projection Model to Estimate a Proton’s Position in a Pencil Beam For Single Sided Proton Imaging,&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Submitted to Physics in Medicine and Biology.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Authors manuscript.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Eikeland, Viljar Nilsen et al. &amp;lt;b&amp;gt; Bergen Proton CT System. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Submitted as proceedings for the 12th Position Sensitive Detectors conference. &amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: psd_proceedings.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
==== Posters ====&lt;br /&gt;
* Eikeland, Viljar Nilsen. &amp;lt;b&amp;gt; Bergen proton CT system. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Presented at the 12th Position Sensitive Detectors conference.&amp;lt;/i&amp;gt; &lt;br /&gt;
** Submitted poster [[Media: poster_PSD12.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Meetings ==&lt;br /&gt;
Hosted on Indico  https://indico.cern.ch/category/13882.&lt;br /&gt;
&lt;br /&gt;
The old pages on the wiki can be found here: [[Meetings]]&lt;br /&gt;
&lt;br /&gt;
Slides from the project [[Workshops | workshops in 2016]]&lt;br /&gt;
&lt;br /&gt;
== [[Commissioning]] ==&lt;br /&gt;
Planning and information on [[Commissioning | commissioning, beam tests, etc]].&lt;br /&gt;
&lt;br /&gt;
== [[Workpackages]] ==&lt;br /&gt;
Sections for the different [[Workpackages | work packages]]&lt;br /&gt;
&lt;br /&gt;
== [[People]] ==&lt;br /&gt;
Contact info of involved people &lt;br /&gt;
&lt;br /&gt;
== [[Links]] ==&lt;br /&gt;
Link collection of topics regarding the project&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* Note: ASK is a placeholder that marks questions &lt;br /&gt;
* Note: Search function is not ideal. It doesn&#039;t find all occurences of the search term, e.g. aries finds libraries but not aries.bccs&lt;br /&gt;
&lt;br /&gt;
* Consult the [//meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=1012</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=1012"/>
		<updated>2024-01-25T22:35:59Z</updated>

		<summary type="html">&lt;p&gt;Mri083: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2770399 Alf Kristoffer Herland - MSc (HVL) - 2021 Development and implementation of data acquisition software for proton computed tomography.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3013935 Rune Almåsbakk - MSc (HVL) - 2022 Design and Implementation of Alignment software for a Digital Tracking Calorimeter used for proton CT.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3045481 Håvard Birkenes - MSc (UiB) - Design of a Configuration and Monitoring System for the Power Supply in the ProtonCT Project.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3076410 Alfred Abbasi - MSc (UiB) - 2023 Hardware and Software Studies for the Alignment of the Proton CT.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3072130 Jakub Bieniek - MSc (UiB) - 2023 Commisioning of the Cooling System for the Bergen Proton Computed Tomography Digital Tracking Calorimeter.]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=1011</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=1011"/>
		<updated>2024-01-25T21:22:27Z</updated>

		<summary type="html">&lt;p&gt;Mri083: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2770399 Alf Kristoffer Herland - MSc (HVL) - 2021 Development and implementation of data acquisition software for proton computed tomography.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3013935 Rune Almåsbakk - MSc (HVL) - 2022 Design and Implementation of Alignment software for a Digital Tracking Calorimeter used for proton CT.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3076410 Alfred Abbasi - MSc (UiB) - 2023 Hardware and Software Studies for the Alignment of the Proton CT.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3072130 Jakub Bieniek - MSc (UiB) - 2023 Commisioning of the Cooling System for the Bergen Proton Computed Tomography Digital Tracking Calorimeter.]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=1010</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=1010"/>
		<updated>2024-01-25T21:21:48Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Theses */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Wiki for the proton CT project&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Howto&#039;s ==&lt;br /&gt;
=== Software ===&lt;br /&gt;
* [[Documentation|Software Documentation]] on how to install and use the involved software packages, how to use the GitLab service, and about the development workflow, etc.&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
* [[Hardware Documentation and Howto&#039;s]] on pReadout, ALPIDE bonding, Production Test Box, Transition Card&lt;br /&gt;
&lt;br /&gt;
=== Control &amp;amp; Readout Software ===&lt;br /&gt;
* [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
=== ALPIDE ===&lt;br /&gt;
* [[ALPIDE Documentation and Papers]]&lt;br /&gt;
&lt;br /&gt;
=== Cooling ===&lt;br /&gt;
[[Cooling Documentation]] on the cooling simulations, measurements, laboratory setup and the final design. &lt;br /&gt;
&lt;br /&gt;
=== Århus Testbeam 2023 ===&lt;br /&gt;
[[Århus Testbeam 2023 Documentation]] on the testbeam at Århus hospital including simulation, setup, equipment used, etc. &lt;br /&gt;
&lt;br /&gt;
== [[Publications]] ==&lt;br /&gt;
List of publications from the project.&lt;br /&gt;
&lt;br /&gt;
==== Workpackage Reports ====&lt;br /&gt;
* [[Media:pCT-WP1-1-Rev2 design recommendations.pdf | pCT-WP1-01-Rev2 Detector design specifications]] (Rev2: Added carrier board thickness recommendations) --- See also submitted article on design optimization&lt;br /&gt;
* [[:File:pCT-WP1-02-Rev3 (Radiation environment and electronics).pdf | pCT-WP1-02-Rev3 Radiation environment and placement of electronics]] (Rev2: Updated results and assumptions, Rev3: Updated with 1-10cm results) (Please feel free to contact [mailto:jars@hvl.no Jarle Rambo Sølie] if there are any questions regarding the contents of this document.&lt;br /&gt;
&lt;br /&gt;
==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2770399 Alf Kristoffer Herland - MSc (HVL) - 2021 Development and implementation of data acquisition software for proton computed tomography.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3013935 Rune Almåsbakk - MSc (HVL) - 2022 Design and Implementation of Alignment software for a Digital Tracking Calorimeter used for proton CT.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3076410 Alfred Abbasi - MSc (UiB) - 2023 Hardware and Software Studies for the Alignment of the Proton CT.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/3072130 Jakub Bieniek - MSc (UiB) - 2023 Commisioning of the Cooling System for the Bergen Proton Computed Tomography Digital Tracking Calorimeter.]&lt;br /&gt;
&lt;br /&gt;
==== Journal Articles ====&lt;br /&gt;
* Aehle, M.,  et al. &amp;lt;b&amp;gt;Exploration of differentiability in a proton computed tomography simulation framework&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Physics in Medicine and Biology&amp;lt;/i&amp;gt;  2023;68(244002). &lt;br /&gt;
** UiB archive: [ http://hdl.handle.net/10852/106386 ]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ad0bdd doi:10.1088/1361-6560/ad0bdd]&lt;br /&gt;
&lt;br /&gt;
* Schilling, A.,  et al. &amp;lt;b&amp;gt;Towards Neural Charged Particle Tracking in Digital Tracking Calorimeters With Reinforcement Learning&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Physics in Medicine and Biology&amp;lt;/i&amp;gt;  2023;68(194001). &lt;br /&gt;
** UiB archive: [ https://hdl.handle.net/11250/3100524 ]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/acf5c2 doi:10.1109/TPAMI.2023.3305027]&amp;lt;/b&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Kortus, T.,  et al. &amp;lt;b&amp;gt;Towards Neural Charged Particle Tracking in Digital Tracking Calorimeters With Reinforcement Learning&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;IEEE Transactions on Pattern Analysis and Machine Intelligence&amp;lt;/i&amp;gt;  2023;45(15820). &lt;br /&gt;
** UiB archive: [ http://hdl.handle.net/10852/106386 ]&lt;br /&gt;
** IEEE link: [https://ieeexplore.ieee.org/document/10219056 doi:10.1088/1361-6560/acf5c2]&lt;br /&gt;
&lt;br /&gt;
* Alme, J., Barnaföldi, G.G., Barthel, R., Borshchov, V., Bodova, T., van den Brink, A., et al. &amp;lt;b&amp;gt;A High-Granularity Digital Tracking Calorimeter Optimized for Proton CT. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Frontiers in Physics.&amp;lt;/i&amp;gt;  2020;8(460). &lt;br /&gt;
** Published manuscript: [[Media:10.3389_fphy.2020.568243.pdf | PDF]]&lt;br /&gt;
** Frontiers link: [https://www.frontiersin.org/article/10.3389/fphy.2020.568243 doi:10.3389/fphy.2020.568243]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Volz, L., Sølie, J. R., Alme, J., Barnaföldi, G.G., Barthel, R. et al. &amp;lt;b&amp;gt;Helium Radiography with a Digital Tracking Calorimeter-a Monte Carlo Study for Secondary Track Rejection. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2021;66(3):035004. &lt;br /&gt;
** Published manuscript: [[Media: Pettersen_2021_Phys._Med._Biol._66_035004.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/abca03 doi:10.1088/1361-6560/abca03]&lt;br /&gt;
&lt;br /&gt;
* Sølie, J.R., Volz, L., Pettersen H.E.S., Piersimoni, P., Odland, O.H., Röhrich, D., et al. &amp;lt;b&amp;gt;Image quality of list-mode proton imaging without front trackers. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2020;65(13):135012. &lt;br /&gt;
** Published manuscript: [[Media: 10.1088_1361-6560_ab8.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ab8ddb doi:10.1088/1361-6560/ab8ddb]&lt;br /&gt;
&lt;br /&gt;
* Tambave, G., Alme, J., Barnaföldi, G.G., Barthel, R., Van Den Brink, A., Brons, S., et al.&amp;lt;b&amp;gt; Characterization of monolithic CMOS pixel sensor chip with ion beams for application in particle computed tomography. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Nuclear Instruments and Methods in Physics Research Section A&amp;lt;/i&amp;gt; 2020;958:162626. &lt;br /&gt;
** Published manuscript: [[Media: Tambave-2020-Characterization-of-monolithic-cm.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/pii/S0168900219311258?via%3Dihub doi:10.1016/j.nima.2019.162626]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Johan Alme, Gergely Gabor Barnafoldi, Alba Garcıa-Santos, Ola Grøttvik, Håvard Helstrup, Kristin Fanebust Hetland, Ilker Meric, Odd Harald Odland, Gabor Papp, Thomas Peitzmann, Dieter Röhrich, Joao Seco, Hesam Shafiee, Eivind Vågslid Skjæveland, Ganesh Tambave, Kjetil Ullaland, Monika Varga-Kofarago, Lennart Volz, Boris Wagner and Shiming Yang. &amp;lt;b&amp;gt;Design Optimization of a Pixel Based Range Telescope for Proton Computed Tomography.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Physica Medica Special Issue: Advances in Geant4 for medicine.&amp;lt;/i&amp;gt; 2019; 63:87-97&lt;br /&gt;
** Published manuscript: [[Media: Pettersen et al. - Design Optimization of a Pixel Based Range Telesco.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/abs/pii/S1120179719301358 doi:10.1016/J.ejmp.2019.05.026 ]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., J. Alme, A. van den Brink, M. Chaar, D. Fehlker, I. Meric, O.H. Odland, et al. &amp;lt;b&amp;gt;Proton Tracking in a High-Granularity Digital Tracking Calorimeter for Proton CT Purposes&amp;lt;/b&amp;gt;.  &amp;lt;i&amp;gt;Nuclear Instruments and Methods in Physics Research A 860C, 51–61. doi:10.1016/j.nima.2017.02.007.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: 1-s2.0-S0168900217301882-main.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0168900217301882 doi:10.1016/j.nima.2017.02.007]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1611.02031 arXiv:1611.02031]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Chaar, M., Meric, I., Odland, O.H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Accuracy of parameterized proton range models; a comparison&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Radiation Physics and Chemistry, 144 (C): 295-297 (2018). doi:10.1016/j.radphyschem.2017.08.02&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: Comparison of different calculation methods of proton ranges.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0969806X17303869?via%3Dihub 10.1016/j.radphyschem.2017.08.028]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1704.08854  arXiv:1704.08854]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H. E. S., and D. Röhrich. 2017. &amp;lt;b&amp;gt;Kreftbehandling Med Protonterapi Og Proton CT.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Fra Fysikkens Verden, December 2017.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published article: [[Media: FFV-proton-CT-ensidig.pdf | PDF]]&lt;br /&gt;
** [http://norskfysisk.no/filer/FFV/2017/FFV-2017-4.pdf Magazine at norskfysisk.no]&lt;br /&gt;
&lt;br /&gt;
==== Submitted ====&lt;br /&gt;
* Pettersen, H.E.S., Meric, I., Odland, O.H., Shafiee, H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Proton Tracking Algorithm for Pixel Based Range Telescopes for Proton Computed Tomography&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Revision submitted to Web of Conferences after the &amp;quot;Connecting the Dots&amp;quot; conference.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Revised manuscript: [[Media: detector-proton-tracking.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Lennart Volz, Jarle Sølie, Dieter Rohrich, and Joao Seco. &amp;lt;b&amp;gt;A Linear Projection Model to Estimate a Proton’s Position in a Pencil Beam For Single Sided Proton Imaging,&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Submitted to Physics in Medicine and Biology.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Authors manuscript.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Eikeland, Viljar Nilsen et al. &amp;lt;b&amp;gt; Bergen Proton CT System. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Submitted as proceedings for the 12th Position Sensitive Detectors conference. &amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: psd_proceedings.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
==== Posters ====&lt;br /&gt;
* Eikeland, Viljar Nilsen. &amp;lt;b&amp;gt; Bergen proton CT system. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Presented at the 12th Position Sensitive Detectors conference.&amp;lt;/i&amp;gt; &lt;br /&gt;
** Submitted poster [[Media: poster_PSD12.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Meetings ==&lt;br /&gt;
Hosted on Indico  https://indico.cern.ch/category/13882.&lt;br /&gt;
&lt;br /&gt;
The old pages on the wiki can be found here: [[Meetings]]&lt;br /&gt;
&lt;br /&gt;
Slides from the project [[Workshops | workshops in 2016]]&lt;br /&gt;
&lt;br /&gt;
== [[Commissioning]] ==&lt;br /&gt;
Planning and information on [[Commissioning | commissioning, beam tests, etc]].&lt;br /&gt;
&lt;br /&gt;
== [[Workpackages]] ==&lt;br /&gt;
Sections for the different [[Workpackages | work packages]]&lt;br /&gt;
&lt;br /&gt;
== [[People]] ==&lt;br /&gt;
Contact info of involved people &lt;br /&gt;
&lt;br /&gt;
== [[Links]] ==&lt;br /&gt;
Link collection of topics regarding the project&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* Note: ASK is a placeholder that marks questions &lt;br /&gt;
* Note: Search function is not ideal. It doesn&#039;t find all occurences of the search term, e.g. aries finds libraries but not aries.bccs&lt;br /&gt;
&lt;br /&gt;
* Consult the [//meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=963</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=963"/>
		<updated>2022-01-20T15:03:11Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* My external user account on GitLab does not give me a namespace for forking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution!&#039;&#039;&#039;: Everybody who has the token can use it, make sure that it does not leak. Usually, tokens are used to allow external apps and tools access to do their job. Such apps store the token as secrets and do not display tokens to the outside.&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible, or better, specify expiration date&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
=== My external user account on GitLab does not give me a namespace for forking ===&lt;br /&gt;
This is a limitation of GitLab service at UiB. The external users do not get their own namespace and a personal fork is thus not possible.&lt;br /&gt;
&lt;br /&gt;
Instead, you can use a common development fork which is created by the project maintainers in subgroup [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
Get in contact with the maintainers to be added with &#039;&#039;developer&#039;&#039; role.&lt;br /&gt;
&lt;br /&gt;
The standard branches of forks in this namespace will be protected. Developers can push feature branches which should have a name &#039;&#039;user_feature&#039;&#039;.&lt;br /&gt;
Merge requests can be created in the usual way.&lt;br /&gt;
&lt;br /&gt;
=== How can I push a feature branch to the common development fork ===&lt;br /&gt;
If you do not have a personal fork and have cloned from the master repository, you can still push your development in a feature branch to the common development forks in [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
&lt;br /&gt;
# Create feature branch if not yet done, since it will be in a common fork, include user name in the branch name&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git checkout -b user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to common fork&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git push git@git.app.uib.no:pct/development/pct-online.git user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
#* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: be extra careful as you are pushing to a common space, especially with forced push.&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
If you are starting to do changes to a branch, e.g. rebasing and resolving conflicts, it&#039;s good to make a copy of the branch.&lt;br /&gt;
&lt;br /&gt;
Simply create a new branch from the current one, and &lt;br /&gt;
 git branch backup_feature&lt;br /&gt;
&lt;br /&gt;
Once you have done the changes, check if there is any difference to the backup&lt;br /&gt;
 git diff backup_feature&lt;br /&gt;
&lt;br /&gt;
After the work has been finished its advisable to remove the backup branch.&lt;br /&gt;
&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
&#039;&#039;coming soon&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
A branch is deleted using &amp;lt;code&amp;gt;branch&amp;lt;/code&amp;gt;-command with option &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-D&amp;lt;/code&amp;gt;, the latter ignoring the check for loss of content, namely if the branch state is already available in other branches.&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
If the branch is not in sync with some other branch you can do (note the fast-forward merge):&lt;br /&gt;
 git rebase other_branch my_feature&lt;br /&gt;
 git checkout other_branch&lt;br /&gt;
 git merge --ff-only my_feature&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
To delete a branch in the fork, an empty refspec is pushed, here the colon &#039;&#039;&#039;:&#039;&#039;&#039; is important.&lt;br /&gt;
 git push origin :my_feature&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Running_Configuration_Software&amp;diff=944</id>
		<title>Running Configuration Software</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Running_Configuration_Software&amp;diff=944"/>
		<updated>2021-06-14T10:18:28Z</updated>

		<summary type="html">&lt;p&gt;Mri083: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]] -&amp;gt; [[Running Configuration Software]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== System requirements ==&lt;br /&gt;
=== Current development system ===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Windows 10 WSL2:&lt;br /&gt;
|-&lt;br /&gt;
|Distributor ID: ||Ubuntu&lt;br /&gt;
|-&lt;br /&gt;
|Description:    ||Ubuntu 20.04.2 LTS&lt;br /&gt;
|-&lt;br /&gt;
|Release:        ||20.04&lt;br /&gt;
|-&lt;br /&gt;
|Codename:       ||focal&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Python 3.8.5 (default, Jan 27 2021, 15:41:15)&lt;br /&gt;
&lt;br /&gt;
Non-standard dependencies are:&lt;br /&gt;
  uhal (from IPbus)&lt;br /&gt;
  PyQt5&lt;br /&gt;
  pymongo&lt;br /&gt;
&lt;br /&gt;
requires Ipbus and MongoDB&lt;br /&gt;
 &lt;br /&gt;
below are my steps to set it up for WSL2, and not tested for anything else. The general steps should be the same regardless. Terminal lines are marked with $.&lt;br /&gt;
&lt;br /&gt;
Installing dependencies:&lt;br /&gt;
&lt;br /&gt;
=== IPbus ===&lt;br /&gt;
&lt;br /&gt;
following https://wiki.uib.no/pct/index.php/Using_IPbus:&lt;br /&gt;
Guide found under &amp;quot;Smart Dummy Hardware&amp;quot;&lt;br /&gt;
More step by step (Instructions partly copied from link above, order slightly changed):&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install git g++ make erlang python3 python-is-python3 libboost1.71-all-dev libpugixml-dev&lt;br /&gt;
&lt;br /&gt;
using the IPbus fork of Alf Herland&lt;br /&gt;
 git clone https://github.com/alf000/ipbus-software.git&lt;br /&gt;
 git checkout smartdummy&lt;br /&gt;
&lt;br /&gt;
In the directory where the repository have been downloaded:&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install prefix=/home/user/ipbus-install&lt;br /&gt;
&lt;br /&gt;
Adding paths to envirorment:&lt;br /&gt;
  export LD_LIBRARY_PATH=/home/user/ipbus-install/lib:$LD_LIBRARY_PATH&lt;br /&gt;
  export PYTHONPATH=/home/user/ipbus-install/lib/python3.8/site-packages:$PYTHONPATH&lt;br /&gt;
&lt;br /&gt;
Originally the second path was user /software-dev/ipbus-install, but i did not have the software-dev part, causing the path to be broken,&lt;br /&gt;
and the uhal module for python was not found.&lt;br /&gt;
&lt;br /&gt;
=== Qt5 designer ===&lt;br /&gt;
&lt;br /&gt;
Following https://askubuntu.com/a/1294861&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install qttools5-dev-tools (Not sure if needed)&lt;br /&gt;
  sudo apt-get install qttools5-dev&lt;br /&gt;
&lt;br /&gt;
Then &#039;designer&#039; command worked for me.&lt;br /&gt;
&lt;br /&gt;
=== PyQt5 ===&lt;br /&gt;
&lt;br /&gt;
Install PyQt5 library with pip:&lt;br /&gt;
  pip3 install PyQt5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== MongoDB ===&lt;br /&gt;
Using a fix for WSl from this https://stackoverflow.com/a/62496101&lt;br /&gt;
Could work for regular Ubuntu and perhaps others, but the important thing is to have the mongodb service open somehow. Did not need anything like this when running other pymongo code in Windows 10.&lt;br /&gt;
  mongodb-org&lt;br /&gt;
  sudo nano /etc/init.d/mongod&lt;br /&gt;
&lt;br /&gt;
Enter this text in the above file: https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d&lt;br /&gt;
  sudo chmod +x /etc/init.d/mongod&lt;br /&gt;
  sudo service mongod start&lt;br /&gt;
&lt;br /&gt;
The last two reset after some time, consistent with new updates.&lt;br /&gt;
&lt;br /&gt;
=== Pymongo ===&lt;br /&gt;
Simple.&lt;br /&gt;
  pip install pymongo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== To run the code ==&lt;br /&gt;
&lt;br /&gt;
=== access the ipbus ===&lt;br /&gt;
* go to ipbus-install. for me its /home/user/ipbus-install. To start it:&lt;br /&gt;
* Go to bin and&lt;br /&gt;
  ./controlhub_start&lt;br /&gt;
* go to /uhal/tests/&lt;br /&gt;
  ./DummyHardwareUdp.exe -p 50001 -v 2 -V&lt;br /&gt;
&lt;br /&gt;
Run program:&lt;br /&gt;
When IPbus is running, open a new terminal window, go to /production_tests/Config_gui/&lt;br /&gt;
  python config_v1.py&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Commissioning&amp;diff=937</id>
		<title>Commissioning</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Commissioning&amp;diff=937"/>
		<updated>2021-05-04T09:22:24Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Commissioning]]&lt;br /&gt;
&lt;br /&gt;
= Beam test 2021 =&lt;br /&gt;
&lt;br /&gt;
== Dates ==&lt;br /&gt;
22 September - 6 October 2021 @ SPS&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
O2 readout tools going to be used to get data from CRU, need the decoder/parser process for the RDH format&lt;br /&gt;
&lt;br /&gt;
Some ALICE tools&lt;br /&gt;
* https://github.com/JianLIUhep/QCUtils&lt;br /&gt;
* https://gitlab.cern.ch/alice-its-wp10-firmware/rawdata-parser&lt;br /&gt;
&lt;br /&gt;
== Planning ==&lt;br /&gt;
The current checklist can be found and edited here: [https://universityofbergen-my.sharepoint.com/:x:/g/personal/viljar_eikeland_uib_no/EWcbIUUzNhZJuWWOg1HhRVEBo2HxSJ37qlY-3kWdB8ZJ5Q?e=kq7bel Checklist SPS]&lt;br /&gt;
&lt;br /&gt;
The current global planning can be found and edited here: [https://universityofbergen-my.sharepoint.com/:x:/g/personal/viljar_eikeland_uib_no/EftvnGEYTd5Mr5w7mGY6SuQBn5BEBtPJI_7_aH78LVPOHg?e=H9qscW Global planning SPS]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Commissioning&amp;diff=935</id>
		<title>Commissioning</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Commissioning&amp;diff=935"/>
		<updated>2021-04-27T09:09:09Z</updated>

		<summary type="html">&lt;p&gt;Mri083: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Commissioning]]&lt;br /&gt;
&lt;br /&gt;
= Beam test 2021 =&lt;br /&gt;
&lt;br /&gt;
== Dates ==&lt;br /&gt;
September 2021 @ SPS&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
== Planning ==&lt;br /&gt;
The current checklist can be found and edited here: [https://universityofbergen-my.sharepoint.com/:x:/g/personal/viljar_eikeland_uib_no/EWcbIUUzNhZJuWWOg1HhRVEBo2HxSJ37qlY-3kWdB8ZJ5Q?e=kq7bel Checklist SPS]&lt;br /&gt;
&lt;br /&gt;
The current global planning can be found and edited here: [https://universityofbergen-my.sharepoint.com/:x:/g/personal/viljar_eikeland_uib_no/EftvnGEYTd5Mr5w7mGY6SuQBn5BEBtPJI_7_aH78LVPOHg?e=H9qscW Global planning SPS]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Commissioning&amp;diff=934</id>
		<title>Commissioning</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Commissioning&amp;diff=934"/>
		<updated>2021-04-27T09:07:33Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Dates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Commissioning]]&lt;br /&gt;
&lt;br /&gt;
= Beam test 2021 =&lt;br /&gt;
&lt;br /&gt;
The current checklist can be found and edited here: [https://universityofbergen-my.sharepoint.com/:x:/g/personal/viljar_eikeland_uib_no/EWcbIUUzNhZJuWWOg1HhRVEBo2HxSJ37qlY-3kWdB8ZJ5Q?e=kq7bel Checklist SPS]&lt;br /&gt;
&lt;br /&gt;
The current global planning can be found and edited here: [https://universityofbergen-my.sharepoint.com/:x:/g/personal/viljar_eikeland_uib_no/EftvnGEYTd5Mr5w7mGY6SuQBn5BEBtPJI_7_aH78LVPOHg?e=H9qscW Global planning SPS]&lt;br /&gt;
&lt;br /&gt;
== Dates ==&lt;br /&gt;
September 2021 @ SPS&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=932</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=932"/>
		<updated>2021-04-22T13:10:55Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Anchoring new page &amp;quot;Commissioning&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Wiki for the proton CT project&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Howto&#039;s ==&lt;br /&gt;
&lt;br /&gt;
* [[Documentation|Software Documentation]] on how to install and use the involved software packages, how to use the GitLab service, and about the development workflow, etc.&lt;br /&gt;
&lt;br /&gt;
* [[Hardware Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[ALPIDE Documentation and Papers]]&lt;br /&gt;
&lt;br /&gt;
== [[Publications]] ==&lt;br /&gt;
List of publications from the project.&lt;br /&gt;
&lt;br /&gt;
==== Workpackage Reports ====&lt;br /&gt;
* [[Media:pCT-WP1-1-Rev2 design recommendations.pdf | pCT-WP1-01-Rev2 Detector design specifications]] (Rev2: Added carrier board thickness recommendations) --- See also submitted article on design optimization&lt;br /&gt;
* [[:File:pCT-WP1-02-Rev3 (Radiation environment and electronics).pdf | pCT-WP1-02-Rev3 Radiation environment and placement of electronics]] (Rev2: Updated results and assumptions, Rev3: Updated with 1-10cm results) (Please feel free to contact [mailto:jars@hvl.no Jarle Rambo Sølie] if there are any questions regarding the contents of this document.&lt;br /&gt;
&lt;br /&gt;
==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
&lt;br /&gt;
==== Journal Articles ====&lt;br /&gt;
* Alme, J., Barnaföldi, G.G., Barthel, R., Borshchov, V., Bodova, T., van den Brink, A., et al. &amp;lt;b&amp;gt;A High-Granularity Digital Tracking Calorimeter Optimized for Proton CT. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Frontiers in Physics.&amp;lt;/i&amp;gt;  2020;8(460). &lt;br /&gt;
** Published manuscript: [[Media:10.3389_fphy.2020.568243.pdf | PDF]]&lt;br /&gt;
** Frontiers link: [https://www.frontiersin.org/article/10.3389/fphy.2020.568243 doi:10.3389/fphy.2020.568243]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Volz, L., Sølie, J. R., Alme, J., Barnaföldi, G.G., Barthel, R. et al. &amp;lt;b&amp;gt;Helium Radiography with a Digital Tracking Calorimeter-a Monte Carlo Study for Secondary Track Rejection. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2021;66(3):035004. &lt;br /&gt;
** Published manuscript: [[Media: Pettersen_2021_Phys._Med._Biol._66_035004.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/abca03 doi:10.1088/1361-6560/abca03]&lt;br /&gt;
&lt;br /&gt;
* Sølie, J.R., Volz, L., Pettersen H.E.S., Piersimoni, P., Odland, O.H., Röhrich, D., et al. &amp;lt;b&amp;gt;Image quality of list-mode proton imaging without front trackers. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2020;65(13):135012. &lt;br /&gt;
** Published manuscript: [[Media: 10.1088_1361-6560_ab8.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ab8ddb doi:10.1088/1361-6560/ab8ddb]&lt;br /&gt;
&lt;br /&gt;
* Tambave, G., Alme, J., Barnaföldi, G.G., Barthel, R., Van Den Brink, A., Brons, S., et al.&amp;lt;b&amp;gt; Characterization of monolithic CMOS pixel sensor chip with ion beams for application in particle computed tomography. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Nuclear Instruments and Methods in Physics Research Section A&amp;lt;/i&amp;gt; 2020;958:162626. &lt;br /&gt;
** Published manuscript: [[Media: Tambave-2020-Characterization-of-monolithic-cm.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/pii/S0168900219311258?via%3Dihub doi:10.1016/j.nima.2019.162626]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., J. Alme, A. van den Brink, M. Chaar, D. Fehlker, I. Meric, O.H. Odland, et al. &amp;lt;b&amp;gt;Proton Tracking in a High-Granularity Digital Tracking Calorimeter for Proton CT Purposes&amp;lt;/b&amp;gt;.  &amp;lt;i&amp;gt;Nuclear Instruments and Methods in Physics Research A 860C, 51–61. doi:10.1016/j.nima.2017.02.007.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: 1-s2.0-S0168900217301882-main.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0168900217301882 doi:10.1016/j.nima.2017.02.007]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1611.02031 arXiv:1611.02031]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Chaar, M., Meric, I., Odland, O.H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Accuracy of parameterized proton range models; a comparison&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Radiation Physics and Chemistry, 144 (C): 295-297 (2018). doi:10.1016/j.radphyschem.2017.08.02&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: Comparison of different calculation methods of proton ranges.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0969806X17303869?via%3Dihub 10.1016/j.radphyschem.2017.08.028]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1704.08854  arXiv:1704.08854]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H. E. S., and D. Röhrich. 2017. &amp;lt;b&amp;gt;Kreftbehandling Med Protonterapi Og Proton CT.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Fra Fysikkens Verden, December 2017.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published article: [[Media: FFV-proton-CT-ensidig.pdf | PDF]]&lt;br /&gt;
** [http://norskfysisk.no/filer/FFV/2017/FFV-2017-4.pdf Magazine at norskfysisk.no]&lt;br /&gt;
&lt;br /&gt;
==== In review ====&lt;br /&gt;
* Pettersen, H.E.S., Meric, I., Odland, O.H., Shafiee, H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Proton Tracking Algorithm for Pixel Based Range Telescopes for Proton Computed Tomography&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Revision submitted to Web of Conferences after the &amp;quot;Connecting the Dots&amp;quot; conference.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Revised manuscript: [[Media: detector-proton-tracking.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Lennart Volz, Jarle Sølie, Dieter Rohrich, and Joao Seco. &amp;lt;b&amp;gt;A Linear Projection Model to Estimate a Proton’s Position in a Pencil Beam For Single Sided Proton Imaging,&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Submitted to Physics in Medicine and Biology.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Authors manuscript.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Johan Alme, Gergely Gabor Barnafoldi, Alba Garcıa-Santos, Ola Grøttvik, Håvard Helstrup, Kristin Fanebust Hetland, Ilker Meric, Odd Harald Odland, Gabor Papp, Thomas Peitzmann, Dieter Röhrich, Joao Seco, Hesam Shafiee, Eivind Vågslid Skjæveland, Ganesh Tambave, Kjetil Ullaland, Monika Varga-Kofarago, Lennart Volz, Boris Wagner and Shiming Yang. &amp;lt;b&amp;gt;Design Optimization of a Pixel Based Range Telescope for Proton Computed Tomography.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Submitted to Physica Medica Special Issue: Advances in Geant4 for medicine.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Pettersen et al. - Design Optimization of a Pixel Based Range Telesco.pdf| PDF]]&lt;br /&gt;
&lt;br /&gt;
==== Work in Progress ====&lt;br /&gt;
* J. Sølie, H. E. S. Pettersen, I. Meric, O. H. Odland, H. Helstrup and D. Röhrich: &amp;lt;b&amp;gt;A comparison of longitudinal and lateral range for protons traversing complex media using GATE, MCNP6 and FLUKA Monte Carlo simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Meetings ==&lt;br /&gt;
Hosted on Indico  https://indico.cern.ch/category/13882.&lt;br /&gt;
&lt;br /&gt;
The old pages on the wiki can be found here: [[Meetings]]&lt;br /&gt;
&lt;br /&gt;
Slides from the project [[Workshops | workshops in 2016]]&lt;br /&gt;
&lt;br /&gt;
== [[Commissioning]] ==&lt;br /&gt;
Planning and information on [[Commissioning | commissioning, beam tests, etc]].&lt;br /&gt;
&lt;br /&gt;
== [[Workpackages]] ==&lt;br /&gt;
Sections for the different [[Workpackages | work packages]]&lt;br /&gt;
&lt;br /&gt;
== [[People]] ==&lt;br /&gt;
Contact info of involved people &lt;br /&gt;
&lt;br /&gt;
== [[Links]] ==&lt;br /&gt;
Link collection of topics regarding the project&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* Note: ASK is a placeholder that marks questions &lt;br /&gt;
* Note: Search function is not ideal. It doesn&#039;t find all occurences of the search term, e.g. aries finds libraries but not aries.bccs&lt;br /&gt;
&lt;br /&gt;
* Consult the [//meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Commissioning&amp;diff=931</id>
		<title>Commissioning</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Commissioning&amp;diff=931"/>
		<updated>2021-04-22T13:10:14Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Creating page &amp;quot;Commissioning&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Commissioning]]&lt;br /&gt;
&lt;br /&gt;
= Beam test 2021 =&lt;br /&gt;
== Dates ==&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=930</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=930"/>
		<updated>2021-04-22T13:04:32Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Workpackages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Wiki for the proton CT project&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Howto&#039;s ==&lt;br /&gt;
&lt;br /&gt;
* [[Documentation|Software Documentation]] on how to install and use the involved software packages, how to use the GitLab service, and about the development workflow, etc.&lt;br /&gt;
&lt;br /&gt;
* [[Hardware Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[ALPIDE Documentation and Papers]]&lt;br /&gt;
&lt;br /&gt;
== [[Publications]] ==&lt;br /&gt;
List of publications from the project.&lt;br /&gt;
&lt;br /&gt;
==== Workpackage Reports ====&lt;br /&gt;
* [[Media:pCT-WP1-1-Rev2 design recommendations.pdf | pCT-WP1-01-Rev2 Detector design specifications]] (Rev2: Added carrier board thickness recommendations) --- See also submitted article on design optimization&lt;br /&gt;
* [[:File:pCT-WP1-02-Rev3 (Radiation environment and electronics).pdf | pCT-WP1-02-Rev3 Radiation environment and placement of electronics]] (Rev2: Updated results and assumptions, Rev3: Updated with 1-10cm results) (Please feel free to contact [mailto:jars@hvl.no Jarle Rambo Sølie] if there are any questions regarding the contents of this document.&lt;br /&gt;
&lt;br /&gt;
==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
&lt;br /&gt;
==== Journal Articles ====&lt;br /&gt;
* Alme, J., Barnaföldi, G.G., Barthel, R., Borshchov, V., Bodova, T., van den Brink, A., et al. &amp;lt;b&amp;gt;A High-Granularity Digital Tracking Calorimeter Optimized for Proton CT. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Frontiers in Physics.&amp;lt;/i&amp;gt;  2020;8(460). &lt;br /&gt;
** Published manuscript: [[Media:10.3389_fphy.2020.568243.pdf | PDF]]&lt;br /&gt;
** Frontiers link: [https://www.frontiersin.org/article/10.3389/fphy.2020.568243 doi:10.3389/fphy.2020.568243]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Volz, L., Sølie, J. R., Alme, J., Barnaföldi, G.G., Barthel, R. et al. &amp;lt;b&amp;gt;Helium Radiography with a Digital Tracking Calorimeter-a Monte Carlo Study for Secondary Track Rejection. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2021;66(3):035004. &lt;br /&gt;
** Published manuscript: [[Media: Pettersen_2021_Phys._Med._Biol._66_035004.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/abca03 doi:10.1088/1361-6560/abca03]&lt;br /&gt;
&lt;br /&gt;
* Sølie, J.R., Volz, L., Pettersen H.E.S., Piersimoni, P., Odland, O.H., Röhrich, D., et al. &amp;lt;b&amp;gt;Image quality of list-mode proton imaging without front trackers. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2020;65(13):135012. &lt;br /&gt;
** Published manuscript: [[Media: 10.1088_1361-6560_ab8.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ab8ddb doi:10.1088/1361-6560/ab8ddb]&lt;br /&gt;
&lt;br /&gt;
* Tambave, G., Alme, J., Barnaföldi, G.G., Barthel, R., Van Den Brink, A., Brons, S., et al.&amp;lt;b&amp;gt; Characterization of monolithic CMOS pixel sensor chip with ion beams for application in particle computed tomography. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Nuclear Instruments and Methods in Physics Research Section A&amp;lt;/i&amp;gt; 2020;958:162626. &lt;br /&gt;
** Published manuscript: [[Media: Tambave-2020-Characterization-of-monolithic-cm.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/pii/S0168900219311258?via%3Dihub doi:10.1016/j.nima.2019.162626]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., J. Alme, A. van den Brink, M. Chaar, D. Fehlker, I. Meric, O.H. Odland, et al. &amp;lt;b&amp;gt;Proton Tracking in a High-Granularity Digital Tracking Calorimeter for Proton CT Purposes&amp;lt;/b&amp;gt;.  &amp;lt;i&amp;gt;Nuclear Instruments and Methods in Physics Research A 860C, 51–61. doi:10.1016/j.nima.2017.02.007.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: 1-s2.0-S0168900217301882-main.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0168900217301882 doi:10.1016/j.nima.2017.02.007]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1611.02031 arXiv:1611.02031]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Chaar, M., Meric, I., Odland, O.H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Accuracy of parameterized proton range models; a comparison&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Radiation Physics and Chemistry, 144 (C): 295-297 (2018). doi:10.1016/j.radphyschem.2017.08.02&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: Comparison of different calculation methods of proton ranges.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0969806X17303869?via%3Dihub 10.1016/j.radphyschem.2017.08.028]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1704.08854  arXiv:1704.08854]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H. E. S., and D. Röhrich. 2017. &amp;lt;b&amp;gt;Kreftbehandling Med Protonterapi Og Proton CT.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Fra Fysikkens Verden, December 2017.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published article: [[Media: FFV-proton-CT-ensidig.pdf | PDF]]&lt;br /&gt;
** [http://norskfysisk.no/filer/FFV/2017/FFV-2017-4.pdf Magazine at norskfysisk.no]&lt;br /&gt;
&lt;br /&gt;
==== In review ====&lt;br /&gt;
* Pettersen, H.E.S., Meric, I., Odland, O.H., Shafiee, H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Proton Tracking Algorithm for Pixel Based Range Telescopes for Proton Computed Tomography&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Revision submitted to Web of Conferences after the &amp;quot;Connecting the Dots&amp;quot; conference.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Revised manuscript: [[Media: detector-proton-tracking.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Lennart Volz, Jarle Sølie, Dieter Rohrich, and Joao Seco. &amp;lt;b&amp;gt;A Linear Projection Model to Estimate a Proton’s Position in a Pencil Beam For Single Sided Proton Imaging,&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Submitted to Physics in Medicine and Biology.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Authors manuscript.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Johan Alme, Gergely Gabor Barnafoldi, Alba Garcıa-Santos, Ola Grøttvik, Håvard Helstrup, Kristin Fanebust Hetland, Ilker Meric, Odd Harald Odland, Gabor Papp, Thomas Peitzmann, Dieter Röhrich, Joao Seco, Hesam Shafiee, Eivind Vågslid Skjæveland, Ganesh Tambave, Kjetil Ullaland, Monika Varga-Kofarago, Lennart Volz, Boris Wagner and Shiming Yang. &amp;lt;b&amp;gt;Design Optimization of a Pixel Based Range Telescope for Proton Computed Tomography.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Submitted to Physica Medica Special Issue: Advances in Geant4 for medicine.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Pettersen et al. - Design Optimization of a Pixel Based Range Telesco.pdf| PDF]]&lt;br /&gt;
&lt;br /&gt;
==== Work in Progress ====&lt;br /&gt;
* J. Sølie, H. E. S. Pettersen, I. Meric, O. H. Odland, H. Helstrup and D. Röhrich: &amp;lt;b&amp;gt;A comparison of longitudinal and lateral range for protons traversing complex media using GATE, MCNP6 and FLUKA Monte Carlo simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Meetings ==&lt;br /&gt;
Hosted on Indico  https://indico.cern.ch/category/13882.&lt;br /&gt;
&lt;br /&gt;
The old pages on the wiki can be found here: [[Meetings]]&lt;br /&gt;
&lt;br /&gt;
Slides from the project [[Workshops | workshops in 2016]]&lt;br /&gt;
&lt;br /&gt;
== [[Workpackages]] ==&lt;br /&gt;
Sections for the different [[Workpackages | work packages]]&lt;br /&gt;
&lt;br /&gt;
== [[People]] ==&lt;br /&gt;
Contact info of involved people &lt;br /&gt;
&lt;br /&gt;
== [[Links]] ==&lt;br /&gt;
Link collection of topics regarding the project&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* Note: ASK is a placeholder that marks questions &lt;br /&gt;
* Note: Search function is not ideal. It doesn&#039;t find all occurences of the search term, e.g. aries finds libraries but not aries.bccs&lt;br /&gt;
&lt;br /&gt;
* Consult the [//meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=929</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=929"/>
		<updated>2021-04-22T13:03:02Z</updated>

		<summary type="html">&lt;p&gt;Mri083: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Wiki for the proton CT project&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Howto&#039;s ==&lt;br /&gt;
&lt;br /&gt;
* [[Documentation|Software Documentation]] on how to install and use the involved software packages, how to use the GitLab service, and about the development workflow, etc.&lt;br /&gt;
&lt;br /&gt;
* [[Hardware Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[ALPIDE Documentation and Papers]]&lt;br /&gt;
&lt;br /&gt;
== [[Publications]] ==&lt;br /&gt;
List of publications from the project.&lt;br /&gt;
&lt;br /&gt;
==== Workpackage Reports ====&lt;br /&gt;
* [[Media:pCT-WP1-1-Rev2 design recommendations.pdf | pCT-WP1-01-Rev2 Detector design specifications]] (Rev2: Added carrier board thickness recommendations) --- See also submitted article on design optimization&lt;br /&gt;
* [[:File:pCT-WP1-02-Rev3 (Radiation environment and electronics).pdf | pCT-WP1-02-Rev3 Radiation environment and placement of electronics]] (Rev2: Updated results and assumptions, Rev3: Updated with 1-10cm results) (Please feel free to contact [mailto:jars@hvl.no Jarle Rambo Sølie] if there are any questions regarding the contents of this document.&lt;br /&gt;
&lt;br /&gt;
==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
&lt;br /&gt;
==== Journal Articles ====&lt;br /&gt;
* Alme, J., Barnaföldi, G.G., Barthel, R., Borshchov, V., Bodova, T., van den Brink, A., et al. &amp;lt;b&amp;gt;A High-Granularity Digital Tracking Calorimeter Optimized for Proton CT. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Frontiers in Physics.&amp;lt;/i&amp;gt;  2020;8(460). &lt;br /&gt;
** Published manuscript: [[Media:10.3389_fphy.2020.568243.pdf | PDF]]&lt;br /&gt;
** Frontiers link: [https://www.frontiersin.org/article/10.3389/fphy.2020.568243 doi:10.3389/fphy.2020.568243]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Volz, L., Sølie, J. R., Alme, J., Barnaföldi, G.G., Barthel, R. et al. &amp;lt;b&amp;gt;Helium Radiography with a Digital Tracking Calorimeter-a Monte Carlo Study for Secondary Track Rejection. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2021;66(3):035004. &lt;br /&gt;
** Published manuscript: [[Media: Pettersen_2021_Phys._Med._Biol._66_035004.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/abca03 doi:10.1088/1361-6560/abca03]&lt;br /&gt;
&lt;br /&gt;
* Sølie, J.R., Volz, L., Pettersen H.E.S., Piersimoni, P., Odland, O.H., Röhrich, D., et al. &amp;lt;b&amp;gt;Image quality of list-mode proton imaging without front trackers. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2020;65(13):135012. &lt;br /&gt;
** Published manuscript: [[Media: 10.1088_1361-6560_ab8.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ab8ddb doi:10.1088/1361-6560/ab8ddb]&lt;br /&gt;
&lt;br /&gt;
* Tambave, G., Alme, J., Barnaföldi, G.G., Barthel, R., Van Den Brink, A., Brons, S., et al.&amp;lt;b&amp;gt; Characterization of monolithic CMOS pixel sensor chip with ion beams for application in particle computed tomography. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Nuclear Instruments and Methods in Physics Research Section A&amp;lt;/i&amp;gt; 2020;958:162626. &lt;br /&gt;
** Published manuscript: [[Media: Tambave-2020-Characterization-of-monolithic-cm.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/pii/S0168900219311258?via%3Dihub doi:10.1016/j.nima.2019.162626]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., J. Alme, A. van den Brink, M. Chaar, D. Fehlker, I. Meric, O.H. Odland, et al. &amp;lt;b&amp;gt;Proton Tracking in a High-Granularity Digital Tracking Calorimeter for Proton CT Purposes&amp;lt;/b&amp;gt;.  &amp;lt;i&amp;gt;Nuclear Instruments and Methods in Physics Research A 860C, 51–61. doi:10.1016/j.nima.2017.02.007.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: 1-s2.0-S0168900217301882-main.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0168900217301882 doi:10.1016/j.nima.2017.02.007]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1611.02031 arXiv:1611.02031]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Chaar, M., Meric, I., Odland, O.H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Accuracy of parameterized proton range models; a comparison&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Radiation Physics and Chemistry, 144 (C): 295-297 (2018). doi:10.1016/j.radphyschem.2017.08.02&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: Comparison of different calculation methods of proton ranges.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0969806X17303869?via%3Dihub 10.1016/j.radphyschem.2017.08.028]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1704.08854  arXiv:1704.08854]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H. E. S., and D. Röhrich. 2017. &amp;lt;b&amp;gt;Kreftbehandling Med Protonterapi Og Proton CT.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Fra Fysikkens Verden, December 2017.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published article: [[Media: FFV-proton-CT-ensidig.pdf | PDF]]&lt;br /&gt;
** [http://norskfysisk.no/filer/FFV/2017/FFV-2017-4.pdf Magazine at norskfysisk.no]&lt;br /&gt;
&lt;br /&gt;
==== In review ====&lt;br /&gt;
* Pettersen, H.E.S., Meric, I., Odland, O.H., Shafiee, H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Proton Tracking Algorithm for Pixel Based Range Telescopes for Proton Computed Tomography&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Revision submitted to Web of Conferences after the &amp;quot;Connecting the Dots&amp;quot; conference.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Revised manuscript: [[Media: detector-proton-tracking.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Lennart Volz, Jarle Sølie, Dieter Rohrich, and Joao Seco. &amp;lt;b&amp;gt;A Linear Projection Model to Estimate a Proton’s Position in a Pencil Beam For Single Sided Proton Imaging,&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Submitted to Physics in Medicine and Biology.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Authors manuscript.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Johan Alme, Gergely Gabor Barnafoldi, Alba Garcıa-Santos, Ola Grøttvik, Håvard Helstrup, Kristin Fanebust Hetland, Ilker Meric, Odd Harald Odland, Gabor Papp, Thomas Peitzmann, Dieter Röhrich, Joao Seco, Hesam Shafiee, Eivind Vågslid Skjæveland, Ganesh Tambave, Kjetil Ullaland, Monika Varga-Kofarago, Lennart Volz, Boris Wagner and Shiming Yang. &amp;lt;b&amp;gt;Design Optimization of a Pixel Based Range Telescope for Proton Computed Tomography.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Submitted to Physica Medica Special Issue: Advances in Geant4 for medicine.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Pettersen et al. - Design Optimization of a Pixel Based Range Telesco.pdf| PDF]]&lt;br /&gt;
&lt;br /&gt;
==== Work in Progress ====&lt;br /&gt;
* J. Sølie, H. E. S. Pettersen, I. Meric, O. H. Odland, H. Helstrup and D. Röhrich: &amp;lt;b&amp;gt;A comparison of longitudinal and lateral range for protons traversing complex media using GATE, MCNP6 and FLUKA Monte Carlo simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Meetings ==&lt;br /&gt;
Hosted on Indico  https://indico.cern.ch/category/13882.&lt;br /&gt;
&lt;br /&gt;
The old pages on the wiki can be found here: [[Meetings]]&lt;br /&gt;
&lt;br /&gt;
Slides from the project [[Workshops | workshops in 2016]]&lt;br /&gt;
&lt;br /&gt;
== [[Workpackages]] ==&lt;br /&gt;
Sections for the different work packages&lt;br /&gt;
&lt;br /&gt;
== [[People]] ==&lt;br /&gt;
Contact info of involved people &lt;br /&gt;
&lt;br /&gt;
== [[Links]] ==&lt;br /&gt;
Link collection of topics regarding the project&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* Note: ASK is a placeholder that marks questions &lt;br /&gt;
* Note: Search function is not ideal. It doesn&#039;t find all occurences of the search term, e.g. aries finds libraries but not aries.bccs&lt;br /&gt;
&lt;br /&gt;
* Consult the [//meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=928</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=928"/>
		<updated>2021-04-22T12:59:46Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Meetings and workshops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Wiki for the proton CT project&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Howto&#039;s ==&lt;br /&gt;
&lt;br /&gt;
* [[Documentation|Software Documentation]] on how to install and use the involved software packages, how to use the GitLab service, and about the development workflow, etc.&lt;br /&gt;
&lt;br /&gt;
* [[Hardware Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[ALPIDE Documentation and Papers]]&lt;br /&gt;
&lt;br /&gt;
== [[Publications]] ==&lt;br /&gt;
List of publications from the project.&lt;br /&gt;
&lt;br /&gt;
==== Workpackage Reports ====&lt;br /&gt;
* [[Media:pCT-WP1-1-Rev2 design recommendations.pdf | pCT-WP1-01-Rev2 Detector design specifications]] (Rev2: Added carrier board thickness recommendations) --- See also submitted article on design optimization&lt;br /&gt;
* [[:File:pCT-WP1-02-Rev3 (Radiation environment and electronics).pdf | pCT-WP1-02-Rev3 Radiation environment and placement of electronics]] (Rev2: Updated results and assumptions, Rev3: Updated with 1-10cm results) (Please feel free to contact [mailto:jars@hvl.no Jarle Rambo Sølie] if there are any questions regarding the contents of this document.&lt;br /&gt;
&lt;br /&gt;
==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
&lt;br /&gt;
==== Journal Articles ====&lt;br /&gt;
* Alme, J., Barnaföldi, G.G., Barthel, R., Borshchov, V., Bodova, T., van den Brink, A., et al. &amp;lt;b&amp;gt;A High-Granularity Digital Tracking Calorimeter Optimized for Proton CT. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Frontiers in Physics.&amp;lt;/i&amp;gt;  2020;8(460). &lt;br /&gt;
** Published manuscript: [[Media:10.3389_fphy.2020.568243.pdf | PDF]]&lt;br /&gt;
** Frontiers link: [https://www.frontiersin.org/article/10.3389/fphy.2020.568243 doi:10.3389/fphy.2020.568243]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Volz, L., Sølie, J. R., Alme, J., Barnaföldi, G.G., Barthel, R. et al. &amp;lt;b&amp;gt;Helium Radiography with a Digital Tracking Calorimeter-a Monte Carlo Study for Secondary Track Rejection. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2021;66(3):035004. &lt;br /&gt;
** Published manuscript: [[Media: Pettersen_2021_Phys._Med._Biol._66_035004.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/abca03 doi:10.1088/1361-6560/abca03]&lt;br /&gt;
&lt;br /&gt;
* Sølie, J.R., Volz, L., Pettersen H.E.S., Piersimoni, P., Odland, O.H., Röhrich, D., et al. &amp;lt;b&amp;gt;Image quality of list-mode proton imaging without front trackers. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2020;65(13):135012. &lt;br /&gt;
** Published manuscript: [[Media: 10.1088_1361-6560_ab8.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ab8ddb doi:10.1088/1361-6560/ab8ddb]&lt;br /&gt;
&lt;br /&gt;
* Tambave, G., Alme, J., Barnaföldi, G.G., Barthel, R., Van Den Brink, A., Brons, S., et al.&amp;lt;b&amp;gt; Characterization of monolithic CMOS pixel sensor chip with ion beams for application in particle computed tomography. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Nuclear Instruments and Methods in Physics Research Section A&amp;lt;/i&amp;gt; 2020;958:162626. &lt;br /&gt;
** Published manuscript: [[Media: Tambave-2020-Characterization-of-monolithic-cm.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/pii/S0168900219311258?via%3Dihub doi:10.1016/j.nima.2019.162626]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., J. Alme, A. van den Brink, M. Chaar, D. Fehlker, I. Meric, O.H. Odland, et al. &amp;lt;b&amp;gt;Proton Tracking in a High-Granularity Digital Tracking Calorimeter for Proton CT Purposes&amp;lt;/b&amp;gt;.  &amp;lt;i&amp;gt;Nuclear Instruments and Methods in Physics Research A 860C, 51–61. doi:10.1016/j.nima.2017.02.007.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: 1-s2.0-S0168900217301882-main.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0168900217301882 doi:10.1016/j.nima.2017.02.007]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1611.02031 arXiv:1611.02031]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Chaar, M., Meric, I., Odland, O.H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Accuracy of parameterized proton range models; a comparison&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Radiation Physics and Chemistry, 144 (C): 295-297 (2018). doi:10.1016/j.radphyschem.2017.08.02&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: Comparison of different calculation methods of proton ranges.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0969806X17303869?via%3Dihub 10.1016/j.radphyschem.2017.08.028]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1704.08854  arXiv:1704.08854]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H. E. S., and D. Röhrich. 2017. &amp;lt;b&amp;gt;Kreftbehandling Med Protonterapi Og Proton CT.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Fra Fysikkens Verden, December 2017.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published article: [[Media: FFV-proton-CT-ensidig.pdf | PDF]]&lt;br /&gt;
** [http://norskfysisk.no/filer/FFV/2017/FFV-2017-4.pdf Magazine at norskfysisk.no]&lt;br /&gt;
&lt;br /&gt;
==== In review ====&lt;br /&gt;
* Pettersen, H.E.S., Meric, I., Odland, O.H., Shafiee, H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Proton Tracking Algorithm for Pixel Based Range Telescopes for Proton Computed Tomography&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Revision submitted to Web of Conferences after the &amp;quot;Connecting the Dots&amp;quot; conference.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Revised manuscript: [[Media: detector-proton-tracking.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Lennart Volz, Jarle Sølie, Dieter Rohrich, and Joao Seco. &amp;lt;b&amp;gt;A Linear Projection Model to Estimate a Proton’s Position in a Pencil Beam For Single Sided Proton Imaging,&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Submitted to Physics in Medicine and Biology.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Authors manuscript.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Johan Alme, Gergely Gabor Barnafoldi, Alba Garcıa-Santos, Ola Grøttvik, Håvard Helstrup, Kristin Fanebust Hetland, Ilker Meric, Odd Harald Odland, Gabor Papp, Thomas Peitzmann, Dieter Röhrich, Joao Seco, Hesam Shafiee, Eivind Vågslid Skjæveland, Ganesh Tambave, Kjetil Ullaland, Monika Varga-Kofarago, Lennart Volz, Boris Wagner and Shiming Yang. &amp;lt;b&amp;gt;Design Optimization of a Pixel Based Range Telescope for Proton Computed Tomography.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Submitted to Physica Medica Special Issue: Advances in Geant4 for medicine.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Pettersen et al. - Design Optimization of a Pixel Based Range Telesco.pdf| PDF]]&lt;br /&gt;
&lt;br /&gt;
==== Work in Progress ====&lt;br /&gt;
* J. Sølie, H. E. S. Pettersen, I. Meric, O. H. Odland, H. Helstrup and D. Röhrich: &amp;lt;b&amp;gt;A comparison of longitudinal and lateral range for protons traversing complex media using GATE, MCNP6 and FLUKA Monte Carlo simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Meetings]] ==&lt;br /&gt;
Hosted on Indico  https://indico.cern.ch/category/13882.&lt;br /&gt;
&lt;br /&gt;
== [[Workshops]] ==&lt;br /&gt;
Slides from the project [[Workshops | workshops]]&lt;br /&gt;
&lt;br /&gt;
== [[Workpackages]] ==&lt;br /&gt;
Sections for the different work packages&lt;br /&gt;
&lt;br /&gt;
== [[People]] ==&lt;br /&gt;
Contact info of involved people &lt;br /&gt;
&lt;br /&gt;
== [[Links]] ==&lt;br /&gt;
Link collection of topics regarding the project&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* Note: ASK is a placeholder that marks questions &lt;br /&gt;
* Note: Search function is not ideal. It doesn&#039;t find all occurences of the search term, e.g. aries finds libraries but not aries.bccs&lt;br /&gt;
&lt;br /&gt;
* Consult the [//meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=927</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Main_Page&amp;diff=927"/>
		<updated>2021-04-22T12:59:19Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Meetings */ Adding the link to the indico page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Wiki for the proton CT project&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Documentation and Howto&#039;s ==&lt;br /&gt;
&lt;br /&gt;
* [[Documentation|Software Documentation]] on how to install and use the involved software packages, how to use the GitLab service, and about the development workflow, etc.&lt;br /&gt;
&lt;br /&gt;
* [[Hardware Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]]&lt;br /&gt;
&lt;br /&gt;
* [[ALPIDE Documentation and Papers]]&lt;br /&gt;
&lt;br /&gt;
== [[Publications]] ==&lt;br /&gt;
List of publications from the project.&lt;br /&gt;
&lt;br /&gt;
==== Workpackage Reports ====&lt;br /&gt;
* [[Media:pCT-WP1-1-Rev2 design recommendations.pdf | pCT-WP1-01-Rev2 Detector design specifications]] (Rev2: Added carrier board thickness recommendations) --- See also submitted article on design optimization&lt;br /&gt;
* [[:File:pCT-WP1-02-Rev3 (Radiation environment and electronics).pdf | pCT-WP1-02-Rev3 Radiation environment and placement of electronics]] (Rev2: Updated results and assumptions, Rev3: Updated with 1-10cm results) (Please feel free to contact [mailto:jars@hvl.no Jarle Rambo Sølie] if there are any questions regarding the contents of this document.&lt;br /&gt;
&lt;br /&gt;
==== Theses ====&lt;br /&gt;
* Daniel Aadnevik - MSc - 2014 - Extremely high-granularity digital tracking calorimeter for the detection of scattered protons in pCT&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/10412/135279255.pdf?sequence=1&amp;amp;isAllowed=y Kristian Austreim - MSc - 2015 - Proton computed tomography readout testing and detector design]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16041/thesis_final.pdf?sequence=1&amp;amp;isAllowed=y Ola Grøttvik - MSc - 2017 - Design of High-Speed Digital Readout System for Use in Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/bitstream/handle/1956/16758/PCT_readout_testing_and_detector_HSchaug.pdf?sequence=1&amp;amp;isAllowed=y Håkon Schaug - MSc - 2017 - Proton Beam Test Of A High Granularity Calorimeter For Proton Computed Tomography]&lt;br /&gt;
* [https://brage.bibsys.no/xmlui/bitstream/handle/11250/2434108/16246_FULLTEXT.pdf?sequence=1&amp;amp;isAllowed=y Even Hansen - MSc - 2017 - Charge Diffusion Modelling for a Monolithic Active Pixel Sensor Detector with Application to Proton CT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/17757 Helge Pettersen - PhD - 2018 - A Digital Tracking Calorimeter for Proton Computed Tomography]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18748 Simon Kristian Huiberts - MSc - 2018 - Characterization of the ALPIDE chip using He ions (Data from Australian Micro beam, cluster size characteristics). ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18058 Viljar Nilsen Ekeland - MSc - 2018 - Characterization of the ALPIDE chip using protons (Data from Oslo beam test, cluster size and LET correlation with different bias voltages).]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/18057 Susmita Afroz - MSc - 2018 - Noise and Cluster Size Studies of ALPIDE-CMOS Pixel Sensor for pCT]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/918/ H&amp;amp;aring;kon Andreas Underdal - MSc (HVL) - 2019 - Data Acquisition and Testing Software for a Proton Computed Tomography System  ]&lt;br /&gt;
* [http://bora.uib.no/handle/1956/20857  Silje Grimstad - MSc (HVL) - 2019 - ALPIDE Cluster simulations (Building database of cluster characteristics, simulation of clusters using said database. Position and cluster separation algorithms)].&lt;br /&gt;
* [http://resolver.tudelft.nl/uuid:e8d3f687-43ff-4d5f-a594-2e7d805f146b Alba Garcia Santos - MSc (Utrecht) - 2019 - Improvements of track reconstruction algorithms in pixel-based pCT calorimeters]&lt;br /&gt;
* [https://hdl.handle.net/1956/21101 Aleksei Kuleshov - MSc - 2019 - Proton CT monitoring and ALPIDE control (MQTT protocol server, System workflow, GUI implementation).]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/1956/24109 Øistein Jelmert Skjolddal - MSc (HVL) - 2020 Scalable Readout for Proton CT - pRU parser and Root interface.]&lt;br /&gt;
* [https://bora.uib.no/bora-xmlui/handle/11250/2716854 Jarle Rambo Sølie - PhD (HVL/UiB) - 2020 A Monte Carlo simulation framework for performance evaluation of a proton imaging system without front trackers.]&lt;br /&gt;
* [https://hdl.handle.net/11250/2725567 Ola Grøttvik - PhD (UiB) - 2021 Design and Implementation of a High-Speed Readout and Control System for a Digital Tracking Calorimeter for proton CT.]&lt;br /&gt;
&lt;br /&gt;
==== Journal Articles ====&lt;br /&gt;
* Alme, J., Barnaföldi, G.G., Barthel, R., Borshchov, V., Bodova, T., van den Brink, A., et al. &amp;lt;b&amp;gt;A High-Granularity Digital Tracking Calorimeter Optimized for Proton CT. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Frontiers in Physics.&amp;lt;/i&amp;gt;  2020;8(460). &lt;br /&gt;
** Published manuscript: [[Media:10.3389_fphy.2020.568243.pdf | PDF]]&lt;br /&gt;
** Frontiers link: [https://www.frontiersin.org/article/10.3389/fphy.2020.568243 doi:10.3389/fphy.2020.568243]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Volz, L., Sølie, J. R., Alme, J., Barnaföldi, G.G., Barthel, R. et al. &amp;lt;b&amp;gt;Helium Radiography with a Digital Tracking Calorimeter-a Monte Carlo Study for Secondary Track Rejection. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2021;66(3):035004. &lt;br /&gt;
** Published manuscript: [[Media: Pettersen_2021_Phys._Med._Biol._66_035004.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/abca03 doi:10.1088/1361-6560/abca03]&lt;br /&gt;
&lt;br /&gt;
* Sølie, J.R., Volz, L., Pettersen H.E.S., Piersimoni, P., Odland, O.H., Röhrich, D., et al. &amp;lt;b&amp;gt;Image quality of list-mode proton imaging without front trackers. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Phys. Med. Biol.&amp;lt;/i&amp;gt; 2020;65(13):135012. &lt;br /&gt;
** Published manuscript: [[Media: 10.1088_1361-6560_ab8.pdf | PDF]]&lt;br /&gt;
** IOP Science link: [https://iopscience.iop.org/article/10.1088/1361-6560/ab8ddb doi:10.1088/1361-6560/ab8ddb]&lt;br /&gt;
&lt;br /&gt;
* Tambave, G., Alme, J., Barnaföldi, G.G., Barthel, R., Van Den Brink, A., Brons, S., et al.&amp;lt;b&amp;gt; Characterization of monolithic CMOS pixel sensor chip with ion beams for application in particle computed tomography. &amp;lt;/b&amp;gt; &amp;lt;i&amp;gt; Nuclear Instruments and Methods in Physics Research Section A&amp;lt;/i&amp;gt; 2020;958:162626. &lt;br /&gt;
** Published manuscript: [[Media: Tambave-2020-Characterization-of-monolithic-cm.pdf| PDF]]&lt;br /&gt;
** Elsevier link: [https://www.sciencedirect.com/science/article/pii/S0168900219311258?via%3Dihub doi:10.1016/j.nima.2019.162626]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., J. Alme, A. van den Brink, M. Chaar, D. Fehlker, I. Meric, O.H. Odland, et al. &amp;lt;b&amp;gt;Proton Tracking in a High-Granularity Digital Tracking Calorimeter for Proton CT Purposes&amp;lt;/b&amp;gt;.  &amp;lt;i&amp;gt;Nuclear Instruments and Methods in Physics Research A 860C, 51–61. doi:10.1016/j.nima.2017.02.007.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: 1-s2.0-S0168900217301882-main.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0168900217301882 doi:10.1016/j.nima.2017.02.007]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1611.02031 arXiv:1611.02031]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H.E.S., Chaar, M., Meric, I., Odland, O.H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Accuracy of parameterized proton range models; a comparison&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Radiation Physics and Chemistry, 144 (C): 295-297 (2018). doi:10.1016/j.radphyschem.2017.08.02&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published manuscript: [[Media: Comparison of different calculation methods of proton ranges.pdf | PDF]]&lt;br /&gt;
** Elsevier link: [http://www.sciencedirect.com/science/article/pii/S0969806X17303869?via%3Dihub 10.1016/j.radphyschem.2017.08.028]&lt;br /&gt;
** arXiv link: [https://arxiv.org/abs/1704.08854  arXiv:1704.08854]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, H. E. S., and D. Röhrich. 2017. &amp;lt;b&amp;gt;Kreftbehandling Med Protonterapi Og Proton CT.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Fra Fysikkens Verden, December 2017.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Published article: [[Media: FFV-proton-CT-ensidig.pdf | PDF]]&lt;br /&gt;
** [http://norskfysisk.no/filer/FFV/2017/FFV-2017-4.pdf Magazine at norskfysisk.no]&lt;br /&gt;
&lt;br /&gt;
==== In review ====&lt;br /&gt;
* Pettersen, H.E.S., Meric, I., Odland, O.H., Shafiee, H., Sølie, J., Röhrich, D. &amp;lt;b&amp;gt;Proton Tracking Algorithm for Pixel Based Range Telescopes for Proton Computed Tomography&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Revision submitted to Web of Conferences after the &amp;quot;Connecting the Dots&amp;quot; conference.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Revised manuscript: [[Media: detector-proton-tracking.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Lennart Volz, Jarle Sølie, Dieter Rohrich, and Joao Seco. &amp;lt;b&amp;gt;A Linear Projection Model to Estimate a Proton’s Position in a Pencil Beam For Single Sided Proton Imaging,&amp;lt;/b&amp;gt;. &amp;lt;i&amp;gt;Submitted to Physics in Medicine and Biology.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Authors manuscript.pdf | PDF]]&lt;br /&gt;
&lt;br /&gt;
* Pettersen, Helge Egil Seime, Johan Alme, Gergely Gabor Barnafoldi, Alba Garcıa-Santos, Ola Grøttvik, Håvard Helstrup, Kristin Fanebust Hetland, Ilker Meric, Odd Harald Odland, Gabor Papp, Thomas Peitzmann, Dieter Röhrich, Joao Seco, Hesam Shafiee, Eivind Vågslid Skjæveland, Ganesh Tambave, Kjetil Ullaland, Monika Varga-Kofarago, Lennart Volz, Boris Wagner and Shiming Yang. &amp;lt;b&amp;gt;Design Optimization of a Pixel Based Range Telescope for Proton Computed Tomography.&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;Submitted to Physica Medica Special Issue: Advances in Geant4 for medicine.&amp;lt;/i&amp;gt;&lt;br /&gt;
** Submitted manuscript: [[Media: Pettersen et al. - Design Optimization of a Pixel Based Range Telesco.pdf| PDF]]&lt;br /&gt;
&lt;br /&gt;
==== Work in Progress ====&lt;br /&gt;
* J. Sølie, H. E. S. Pettersen, I. Meric, O. H. Odland, H. Helstrup and D. Röhrich: &amp;lt;b&amp;gt;A comparison of longitudinal and lateral range for protons traversing complex media using GATE, MCNP6 and FLUKA Monte Carlo simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Meetings and workshops]] ==&lt;br /&gt;
Hosted on Indico  https://indico.cern.ch/category/13882.&lt;br /&gt;
&lt;br /&gt;
== [[Workshops]] ==&lt;br /&gt;
Slides from the project [[Workshops | workshops]]&lt;br /&gt;
&lt;br /&gt;
== [[Workpackages]] ==&lt;br /&gt;
Sections for the different work packages&lt;br /&gt;
&lt;br /&gt;
== [[People]] ==&lt;br /&gt;
Contact info of involved people &lt;br /&gt;
&lt;br /&gt;
== [[Links]] ==&lt;br /&gt;
Link collection of topics regarding the project&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* Note: ASK is a placeholder that marks questions &lt;br /&gt;
* Note: Search function is not ideal. It doesn&#039;t find all occurences of the search term, e.g. aries finds libraries but not aries.bccs&lt;br /&gt;
&lt;br /&gt;
* Consult the [//meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=920</id>
		<title>Software structure</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=920"/>
		<updated>2021-03-29T10:58:29Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* General guidelines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a brainstorming document for the general software structure of the pCT project and the operation of the full pipeline.&lt;br /&gt;
&lt;br /&gt;
== General guidelines ==&lt;br /&gt;
* support multiple programming languages&lt;br /&gt;
* open for the programming tools best suited for a specific purpose and development group&lt;br /&gt;
* use common/open source packages where ever possible&lt;br /&gt;
* every component comes with a unit test&lt;br /&gt;
&lt;br /&gt;
== Presentations ==&lt;br /&gt;
Some presentations in the course of discussion&lt;br /&gt;
* [[Media:IntroToAutomaticDifferentiationWithCoDiPack Max Aehle 2021-03-22.pdf | IntroToAutomaticDifferentiationWithCoDiPack Max Aehle 2021-03-22.pdf]]&lt;br /&gt;
* [[Media:2021-03-29 mrichter pct-software-tasks.pdf | 2021-03-29_mrichter_pct-software-tasks.pdf]]&lt;br /&gt;
&lt;br /&gt;
== Software Modules ==&lt;br /&gt;
[[File:Software-task-sequence.png]]&lt;br /&gt;
&lt;br /&gt;
== Optimisation ==&lt;br /&gt;
* Intro to Automatic Differentiation with CoDiPack, Max Aehle, 2021-03-22 [[Media:IntroToAutomaticDifferentiationWithCoDiPack_Max_Aehle_2021-03-22.pdf]]&lt;br /&gt;
&lt;br /&gt;
=== Main data path ===&lt;br /&gt;
* Simulation&lt;br /&gt;
** Beam Simulation&lt;br /&gt;
** Phantom Simulation&lt;br /&gt;
** Detector Propagation&lt;br /&gt;
* Detector Response Simulation&lt;br /&gt;
* Readout Simulation&lt;br /&gt;
* Readout and Raw Data reconstruction&lt;br /&gt;
** pct-online&lt;br /&gt;
* Detector Reconstruction&lt;br /&gt;
** Most likely entrance step and hull algorithm needed for the single-sided setup&lt;br /&gt;
** Clustering and Tracking&lt;br /&gt;
* Phantom reconstruction&lt;br /&gt;
* Imaging&lt;br /&gt;
&lt;br /&gt;
[[File:SignalChain.png|border|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
* Visualization&lt;br /&gt;
* Control&lt;br /&gt;
* Monitoring&lt;br /&gt;
&lt;br /&gt;
== Contact information of maintainers/experts for each software module ==&lt;br /&gt;
&lt;br /&gt;
== Build system and package management ==&lt;br /&gt;
&lt;br /&gt;
== Common software modules ==&lt;br /&gt;
=== Data model ===&lt;br /&gt;
* Bridge Design Pattern [[Media:Bridge_Design_Pattern.pdf]]&lt;br /&gt;
&lt;br /&gt;
=== Common IO ===&lt;br /&gt;
=== IPC ===&lt;br /&gt;
=== Logging ===&lt;br /&gt;
=== Control ===&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=File:2021-03-29_mrichter_pct-software-tasks.pdf&amp;diff=919</id>
		<title>File:2021-03-29 mrichter pct-software-tasks.pdf</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=File:2021-03-29_mrichter_pct-software-tasks.pdf&amp;diff=919"/>
		<updated>2021-03-29T10:54:06Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Presentation in ML meeting Monday 29 March; some thoughts regarding structuring the software pieline&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Presentation in ML meeting Monday 29 March; some thoughts regarding structuring the software pieline&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=912</id>
		<title>Software structure</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=912"/>
		<updated>2021-03-22T09:27:23Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Software Modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[Software structure]]&lt;br /&gt;
&lt;br /&gt;
This is a brainstorming document for the general software structure of the pCT project and the operation of the full pipeline.&lt;br /&gt;
&lt;br /&gt;
== General guidelines ==&lt;br /&gt;
* support multiple programming languages&lt;br /&gt;
* open for the programming tools best suited for a specific purpose and development group&lt;br /&gt;
* use common/open source packages where ever possible&lt;br /&gt;
* every component comes with a unit test&lt;br /&gt;
&lt;br /&gt;
== Software Modules ==&lt;br /&gt;
[[File:Software-task-sequence.png]]&lt;br /&gt;
&lt;br /&gt;
=== Main data path ===&lt;br /&gt;
* Simulation&lt;br /&gt;
** Beam Simulation&lt;br /&gt;
** Phantom Simulation&lt;br /&gt;
** Detector Propagation&lt;br /&gt;
* Detector Response Simulation&lt;br /&gt;
* Readout Simulation&lt;br /&gt;
* Readout and Raw Data reconstruction&lt;br /&gt;
** pct-online&lt;br /&gt;
* Detector Reconstruction&lt;br /&gt;
** Clustering and Tracking&lt;br /&gt;
* Phantom reconstruction&lt;br /&gt;
* Imaging&lt;br /&gt;
&lt;br /&gt;
[[File:SignalChain.png|border|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
* Visualization&lt;br /&gt;
* Control&lt;br /&gt;
* Monitoring&lt;br /&gt;
&lt;br /&gt;
== Contact information of maintainers/experts for each software module ==&lt;br /&gt;
&lt;br /&gt;
== Build system and package management ==&lt;br /&gt;
&lt;br /&gt;
== Common software modules ==&lt;br /&gt;
=== Data model ===&lt;br /&gt;
=== Common IO ===&lt;br /&gt;
=== IPC ===&lt;br /&gt;
=== Logging ===&lt;br /&gt;
=== Control ===&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=909</id>
		<title>Software structure</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=909"/>
		<updated>2021-03-17T16:13:20Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Build system and package management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[Software structure]]&lt;br /&gt;
&lt;br /&gt;
This is a brainstorming document for the general software structure of the pCT project and the operation of the full pipeline.&lt;br /&gt;
&lt;br /&gt;
== General guidelines ==&lt;br /&gt;
* support multiple programming languages&lt;br /&gt;
* open for the programming tools best suited for a specific purpose and development group&lt;br /&gt;
* use common/open source packages where ever possible&lt;br /&gt;
* every component comes with a unit test&lt;br /&gt;
&lt;br /&gt;
== Software Modules ==&lt;br /&gt;
[[File:Software-task-sequence.png]]&lt;br /&gt;
&lt;br /&gt;
=== Main data path ===&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
* Visualization&lt;br /&gt;
* Control&lt;br /&gt;
* Monitoring&lt;br /&gt;
&lt;br /&gt;
== Contact information of maintainers/experts for each software module ==&lt;br /&gt;
&lt;br /&gt;
== Build system and package management ==&lt;br /&gt;
&lt;br /&gt;
== Common software modules ==&lt;br /&gt;
=== Data model ===&lt;br /&gt;
=== Common IO ===&lt;br /&gt;
=== IPC ===&lt;br /&gt;
=== Logging ===&lt;br /&gt;
=== Control ===&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=907</id>
		<title>Software structure</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=907"/>
		<updated>2021-03-17T13:38:54Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Software Modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[Software structure]]&lt;br /&gt;
&lt;br /&gt;
This is a brainstorming document for the general software structure of the pCT project and the operation of the full pipeline.&lt;br /&gt;
&lt;br /&gt;
== General guidelines ==&lt;br /&gt;
* support multiple programming languages&lt;br /&gt;
* open for the programming tools best suited for a specific purpose and development group&lt;br /&gt;
* use common/open source packages where ever possible&lt;br /&gt;
* every component comes with a unit test&lt;br /&gt;
&lt;br /&gt;
== Software Modules ==&lt;br /&gt;
[[File:Software-task-sequence.png]]&lt;br /&gt;
&lt;br /&gt;
=== Main data path ===&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
* Visualization&lt;br /&gt;
* Control&lt;br /&gt;
* Monitoring&lt;br /&gt;
&lt;br /&gt;
== Build system and package management ==&lt;br /&gt;
&lt;br /&gt;
== Common software modules ==&lt;br /&gt;
=== Data model ===&lt;br /&gt;
=== Common IO ===&lt;br /&gt;
=== IPC ===&lt;br /&gt;
=== Logging ===&lt;br /&gt;
=== Control ===&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=File:Software-task-sequence.png&amp;diff=906</id>
		<title>File:Software-task-sequence.png</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=File:Software-task-sequence.png&amp;diff=906"/>
		<updated>2021-03-17T13:38:16Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Sketch of the data flow through the different software modules of the pCT project.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sketch of the data flow through the different software modules of the pCT project.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=905</id>
		<title>Software structure</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Software_structure&amp;diff=905"/>
		<updated>2021-03-17T11:44:50Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Creating new page for software structure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[Software structure]]&lt;br /&gt;
&lt;br /&gt;
This is a brainstorming document for the general software structure of the pCT project and the operation of the full pipeline.&lt;br /&gt;
&lt;br /&gt;
== General guidelines ==&lt;br /&gt;
* support multiple programming languages&lt;br /&gt;
* open for the programming tools best suited for a specific purpose and development group&lt;br /&gt;
* use common/open source packages where ever possible&lt;br /&gt;
* every component comes with a unit test&lt;br /&gt;
&lt;br /&gt;
== Software Modules ==&lt;br /&gt;
=== Main data path ===&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
* Visualization&lt;br /&gt;
* Control&lt;br /&gt;
* Monitoring&lt;br /&gt;
&lt;br /&gt;
== Build system and package management ==&lt;br /&gt;
&lt;br /&gt;
== Common software modules ==&lt;br /&gt;
=== Data model ===&lt;br /&gt;
=== Common IO ===&lt;br /&gt;
=== IPC ===&lt;br /&gt;
=== Logging ===&lt;br /&gt;
=== Control ===&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Documentation&amp;diff=904</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Documentation&amp;diff=904"/>
		<updated>2021-03-17T11:28:12Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Starting new page for software structure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation | Software Documentation]]&lt;br /&gt;
&lt;br /&gt;
This is the landing page for software documentation, installation instructions, the development workflow, etc.&lt;br /&gt;
&lt;br /&gt;
== Mailing lists and collaborative tools ==&lt;br /&gt;
* Project web page: [https://www.uib.no/en/ift/142356/medical-physics-bergen-pct-project https://www.uib.no/en/ift/142356/medical-physics-bergen-pct-project]&lt;br /&gt;
* General mailing list: pCT@uib.no&lt;br /&gt;
* [https://pctbergen.slack.com Slack project]&lt;br /&gt;
&lt;br /&gt;
== [[Software structure]] ==&lt;br /&gt;
&lt;br /&gt;
== Software installation ==&lt;br /&gt;
* [[Software tutorial at IFT]]&lt;br /&gt;
* [[ROOT installation]]&lt;br /&gt;
* [[Geant 4 installation]]&lt;br /&gt;
* [[Gate installation]]&lt;br /&gt;
* [[FLUKA installation]]&lt;br /&gt;
* [[Insight Toolkit (ITK) installation]]&lt;br /&gt;
*: https://itk.org/&lt;br /&gt;
*: https://github.com/InsightSoftwareConsortium/ITK&lt;br /&gt;
* [[Reconstruction Toolkit (RTK) installation]]&lt;br /&gt;
*: http://www.openrtk.org/&lt;br /&gt;
*: https://github.com/SimonRit/RTK&lt;br /&gt;
*[[DTC toolkit|DTC Toolkit for reconstruction]]&lt;br /&gt;
*: [[Software for design optimization|User guide and tutorial]]&lt;br /&gt;
*: https://github.com/HelgeEgil/focal (to be merged into gitlab)&lt;br /&gt;
*: [[Cluster convolution for GATE]]&lt;br /&gt;
* [[Visualization Toolkit (VTK) Installation and usage]]&lt;br /&gt;
*: http://www.vtk.org/&lt;br /&gt;
*: https://github.com/Kitware/VTK&lt;br /&gt;
* [[Docker containers]]&lt;br /&gt;
&lt;br /&gt;
== Software repositories ==&lt;br /&gt;
We use the &#039;&#039;&#039;GitLab&#039;&#039;&#039; service hosted by IT of University of Bergen: [https://git.app.uib.no/ https://git.app.uib.no/]&lt;br /&gt;
&lt;br /&gt;
=== Get access to the repositories - with UiB account ===&lt;br /&gt;
Open the [https://git.app.uib.no/pct UiB gitlab web interface].&lt;br /&gt;
&lt;br /&gt;
Log in with your UiB account, then the administrators will give you access to the pCT group. Since authentication goes via Dataporten service, accounts from other Norwegian universities or institutions can be used in the same way.&lt;br /&gt;
&lt;br /&gt;
=== Get access to the repositories - without UiB account ===&lt;br /&gt;
It is possible to use a github user account to login to the UiB GitLab, however such external users are not allowed to create forks in the GitLab domain.&lt;br /&gt;
Since forks are mandatory for the development cycle, github logins can effectively only be used for read access. Again the repository administrators&lt;br /&gt;
need to add you to the pCT group.&lt;br /&gt;
&lt;br /&gt;
Guest accounts for external developers can be set up, get in contact with the group over the general [[Documentation#Mailing lists and collaborative tools | channels]]&lt;br /&gt;
&lt;br /&gt;
Further information on GitLab in general can by found on the following external webpages:&lt;br /&gt;
* [https://docs.gitlab.com/ce/gitlab-basics/README.html Gitlab basics]&lt;br /&gt;
* [https://docs.gitlab.com/ee/workflow/README.html  Gitlab workflow]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The specific instructions how to use the repositories within the pCT project are collected in the following pages:&lt;br /&gt;
==== [[GitLab best practice]] ====&lt;br /&gt;
==== [[GitLab Developer FAQ]] ====&lt;br /&gt;
==== [[Gitlab Master FAQ]] ====&lt;br /&gt;
&lt;br /&gt;
== Getting the code ==&lt;br /&gt;
If you simply need the code, you can download an archive from the GitLab web interface. However, if there is a tiny chance that you might start developing, the recommended way is to clone the repository. See [[GitLab best practice#Roles]].&lt;br /&gt;
&lt;br /&gt;
== Development workflow ==&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access, see [[GitLab Developer FAQ#Working with forks]].&lt;br /&gt;
&lt;br /&gt;
A local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039;, see [[GitLab Developer FAQ#How can I make a clone of a project in my fork]].&lt;br /&gt;
&lt;br /&gt;
== User documentation ==&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=903</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=903"/>
		<updated>2021-03-17T07:06:43Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* How do I update a branch after fulfilled merge request? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution!&#039;&#039;&#039;: Everybody who has the token can use it, make sure that it does not leak. Usually, tokens are used to allow external apps and tools access to do their job. Such apps store the token as secrets and do not display tokens to the outside.&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible, or better, specify expiration date&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
=== My external user account on GitLab does not give me a namespace for forking ===&lt;br /&gt;
This is a limitation of GitLab, the external users do not get their own namespace and a personal fork is thus not possible.&lt;br /&gt;
&lt;br /&gt;
Instead, you can use a common development fork which is created by the project maintainers in subgroup [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
Get in contact with the maintainers to be added with &#039;&#039;developer&#039;&#039; role.&lt;br /&gt;
&lt;br /&gt;
The standard branches of forks in this namespace will be protected. Developers can push feature branches which should have a name &#039;&#039;user_feature&#039;&#039;.&lt;br /&gt;
Merge requests can be created in the usual way.&lt;br /&gt;
&lt;br /&gt;
=== How can I push a feature branch to the common development fork ===&lt;br /&gt;
If you do not have a personal fork and have cloned from the master repository, you can still push your development in a feature branch to the common development forks in [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
&lt;br /&gt;
# Create feature branch if not yet done, since it will be in a common fork, include user name in the branch name&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git checkout -b user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to common fork&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git push git@git.app.uib.no:pct/development/pct-online.git user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
#* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: be extra careful as you are pushing to a common space, especially with forced push.&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
If you are starting to do changes to a branch, e.g. rebasing and resolving conflicts, it&#039;s good to make a copy of the branch.&lt;br /&gt;
&lt;br /&gt;
Simply create a new branch from the current one, and &lt;br /&gt;
 git branch backup_feature&lt;br /&gt;
&lt;br /&gt;
Once you have done the changes, check if there is any difference to the backup&lt;br /&gt;
 git diff backup_feature&lt;br /&gt;
&lt;br /&gt;
After the work has been finished its advisable to remove the backup branch.&lt;br /&gt;
&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
&#039;&#039;coming soon&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
A branch is deleted using &amp;lt;code&amp;gt;branch&amp;lt;/code&amp;gt;-command with option &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-D&amp;lt;/code&amp;gt;, the latter ignoring the check for loss of content, namely if the branch state is already available in other branches.&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
If the branch is not in sync with some other branch you can do (note the fast-forward merge):&lt;br /&gt;
 git rebase other_branch my_feature&lt;br /&gt;
 git checkout other_branch&lt;br /&gt;
 git merge --ff-only my_feature&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
To delete a branch in the fork, an empty refspec is pushed, here the colon &#039;&#039;&#039;:&#039;&#039;&#039; is important.&lt;br /&gt;
 git push origin :my_feature&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Gitlab_Master_FAQ&amp;diff=902</id>
		<title>Gitlab Master FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Gitlab_Master_FAQ&amp;diff=902"/>
		<updated>2021-03-10T10:18:50Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Stop docker container */ docker container needs to be stopped before it can be removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[Gitlab Master FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for project maintainers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
=== Mirror a repository ===&lt;br /&gt;
GitLab supports mirroring of a repository, the GitLab version provided by UiB supports mirroring by &#039;&#039;push&#039;&#039;. That means, repository content is pushed to another repository.&lt;br /&gt;
&lt;br /&gt;
The set this up&lt;br /&gt;
# Create a R/W repository access token in the target repository&lt;br /&gt;
# In the source repository choose &#039;&#039;&#039;Settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Repository&#039;&#039;&#039; and expand &#039;&#039;&#039;Mirroring repositories&#039;&#039;&#039;&lt;br /&gt;
#: &#039;&#039;&#039;Git repository URL&#039;&#039;&#039;: https://oauth2@git.app.uib.no/group/project&lt;br /&gt;
#: &#039;&#039;&#039;Mirror direction&#039;&#039;&#039;: Push (this is fixed in the current version of GitLab)&lt;br /&gt;
#: &#039;&#039;&#039;Authentication method&#039;&#039;&#039;: Password (this is fixed in the current version of GitLab)&lt;br /&gt;
#: &#039;&#039;&#039;Password&#039;&#039;&#039;: the access token&lt;br /&gt;
# Choose options, whether to prohibit diverging refs, and which branches to mirror. In most cases the mirroring should not be done for all branches but only the protected ones (which represent the stable development).&lt;br /&gt;
# Click &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Mirror repository&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GitLab takes care of automatically pushing changes to mirror repository. Alternatively, update can be triggered from the Web interface&lt;br /&gt;
&lt;br /&gt;
Example link&lt;br /&gt;
    https://oauth2@git.app.uib.no/pct/development/pct-online&lt;br /&gt;
&lt;br /&gt;
== Setup GitLab CI ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring CI ===&lt;br /&gt;
&lt;br /&gt;
=== Add specific runner ===&lt;br /&gt;
The CI is executed by a so-called &#039;&#039;runner&#039;&#039;, usually a GitLab service also provides a few shared runners. As they might be limited in capacity and availability, specific runners can be set up. Specific runners make use of resources you can control.&lt;br /&gt;
&lt;br /&gt;
If you have access to a resources providing &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt;, the runner can be set up with a few lines.&lt;br /&gt;
&lt;br /&gt;
External links in the GitLab documentation&lt;br /&gt;
* [https://docs.gitlab.com/runner/install/docker.html https://docs.gitlab.com/runner/install/docker.html]&lt;br /&gt;
* [https://docs.gitlab.com/runner/register/index.html#docker https://docs.gitlab.com/runner/register/index.html#docker]&lt;br /&gt;
&lt;br /&gt;
==== Launch docker container ====&lt;br /&gt;
Create the docker volume for the configuration of the runner, this volume is mounted in the container executing the runner&lt;br /&gt;
 docker volume create gitlab-runner-config-projectname&lt;br /&gt;
&lt;br /&gt;
Start the runner in a container&lt;br /&gt;
 docker run -d --restart always -v /var/run/docker.sock:/var/run/docker.sock -v gitlab-runner-config-projectname:/etc/gitlab-runner --name gitlab-runner-projectname gitlab/gitlab-runner:latest&lt;br /&gt;
&lt;br /&gt;
==== Register ====&lt;br /&gt;
Launch a container with command &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt;, the container comes with a pseudo tty connected stdin (options &amp;lt;code&amp;gt;-it&amp;lt;/code&amp;gt;) and is deleted when done (option&amp;lt;code&amp;gt;--rm&amp;lt;/code&amp;gt;)&lt;br /&gt;
 docker run --rm -it -v gitlab-runner-config-projectname:/etc/gitlab-runner gitlab/gitlab-runner:latest register&lt;br /&gt;
&lt;br /&gt;
Follow the instructions and enter URL of GitLab service and registration token, name of the instance and a few other options.&lt;br /&gt;
&lt;br /&gt;
==== Stop docker container ====&lt;br /&gt;
Stop, note that container will not be deleted, but it disappears from the list of active containers, use &amp;lt;code&amp;gt;--all&amp;lt;/code&amp;gt; to list all containers&lt;br /&gt;
 docker container stop gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
Once the container is stopped, it can also be removed:&lt;br /&gt;
 docker container rm gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
or, it can be restarted again:&lt;br /&gt;
 docker container stop gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
==== Limit number of cores used by the runner ====&lt;br /&gt;
Use option &amp;lt;code&amp;gt;--cpuset-cpus&amp;lt;/code&amp;gt; to assign dedicated CPUs to the container. There is also an option &amp;lt;code&amp;gt;--cpus&amp;lt;/code&amp;gt; to specify a fraction of cores to be used, but this will not effect the &amp;lt;code&amp;gt;nproc&amp;lt;/code&amp;gt; command in the container.&lt;br /&gt;
&lt;br /&gt;
To utilize all but 2 cores of the host system, e.g. start with the calculated value:&lt;br /&gt;
  cpus=`nproc`; docker run --cpuset-cpus=&amp;quot;0-$((cpus - 3))&amp;quot; ...&lt;br /&gt;
&lt;br /&gt;
In the container, the &amp;lt;code&amp;gt;nproc&amp;lt;/code&amp;gt; command can be used to retrieve the number number of cores, e.g. to pass it to the build system.&lt;br /&gt;
&lt;br /&gt;
=== Importing an external package ===&lt;br /&gt;
The project will use a couple of external packages which are hosted in a different master repository. Copies of such external packages can be added to the gitlab server under our project group to provide a consistent package.&lt;br /&gt;
&lt;br /&gt;
Here is a proposed workflow for importing a package which is already hosted in git.&lt;br /&gt;
# Create new repository in the pCT group or ask for creation, lets call it &#039;&#039;newPackage&#039;&#039;&lt;br /&gt;
# Fork the repository to your user space&lt;br /&gt;
# Clone the package you want to import&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone &amp;lt;some_external_link&amp;gt; newPackage # we give it the new name&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; cd newPackage&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Redirect upstream URL to the fork in your gitlab user space&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git remote set-url origin https://user@gitlab.uib.no/user/newPackage.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Now make a forced push (option &#039;&#039;-f&#039;&#039;) to import the repository to your fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push -f origin&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Create merge request to branch &#039;&#039;import&#039;&#039; (if not existing, &#039;&#039;master&#039;&#039; or any other appropriate branch) by following the instructions [[Documentation#Pull/Merge request | Pull/Merge request]]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Gitlab_Master_FAQ&amp;diff=901</id>
		<title>Gitlab Master FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Gitlab_Master_FAQ&amp;diff=901"/>
		<updated>2021-03-10T10:15:16Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Stop docker container */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[Gitlab Master FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for project maintainers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
=== Mirror a repository ===&lt;br /&gt;
GitLab supports mirroring of a repository, the GitLab version provided by UiB supports mirroring by &#039;&#039;push&#039;&#039;. That means, repository content is pushed to another repository.&lt;br /&gt;
&lt;br /&gt;
The set this up&lt;br /&gt;
# Create a R/W repository access token in the target repository&lt;br /&gt;
# In the source repository choose &#039;&#039;&#039;Settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Repository&#039;&#039;&#039; and expand &#039;&#039;&#039;Mirroring repositories&#039;&#039;&#039;&lt;br /&gt;
#: &#039;&#039;&#039;Git repository URL&#039;&#039;&#039;: https://oauth2@git.app.uib.no/group/project&lt;br /&gt;
#: &#039;&#039;&#039;Mirror direction&#039;&#039;&#039;: Push (this is fixed in the current version of GitLab)&lt;br /&gt;
#: &#039;&#039;&#039;Authentication method&#039;&#039;&#039;: Password (this is fixed in the current version of GitLab)&lt;br /&gt;
#: &#039;&#039;&#039;Password&#039;&#039;&#039;: the access token&lt;br /&gt;
# Choose options, whether to prohibit diverging refs, and which branches to mirror. In most cases the mirroring should not be done for all branches but only the protected ones (which represent the stable development).&lt;br /&gt;
# Click &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Mirror repository&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GitLab takes care of automatically pushing changes to mirror repository. Alternatively, update can be triggered from the Web interface&lt;br /&gt;
&lt;br /&gt;
Example link&lt;br /&gt;
    https://oauth2@git.app.uib.no/pct/development/pct-online&lt;br /&gt;
&lt;br /&gt;
== Setup GitLab CI ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring CI ===&lt;br /&gt;
&lt;br /&gt;
=== Add specific runner ===&lt;br /&gt;
The CI is executed by a so-called &#039;&#039;runner&#039;&#039;, usually a GitLab service also provides a few shared runners. As they might be limited in capacity and availability, specific runners can be set up. Specific runners make use of resources you can control.&lt;br /&gt;
&lt;br /&gt;
If you have access to a resources providing &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt;, the runner can be set up with a few lines.&lt;br /&gt;
&lt;br /&gt;
External links in the GitLab documentation&lt;br /&gt;
* [https://docs.gitlab.com/runner/install/docker.html https://docs.gitlab.com/runner/install/docker.html]&lt;br /&gt;
* [https://docs.gitlab.com/runner/register/index.html#docker https://docs.gitlab.com/runner/register/index.html#docker]&lt;br /&gt;
&lt;br /&gt;
==== Launch docker container ====&lt;br /&gt;
Create the docker volume for the configuration of the runner, this volume is mounted in the container executing the runner&lt;br /&gt;
 docker volume create gitlab-runner-config-projectname&lt;br /&gt;
&lt;br /&gt;
Start the runner in a container&lt;br /&gt;
 docker run -d --restart always -v /var/run/docker.sock:/var/run/docker.sock -v gitlab-runner-config-projectname:/etc/gitlab-runner --name gitlab-runner-projectname gitlab/gitlab-runner:latest&lt;br /&gt;
&lt;br /&gt;
==== Register ====&lt;br /&gt;
Launch a container with command &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt;, the container comes with a pseudo tty connected stdin (options &amp;lt;code&amp;gt;-it&amp;lt;/code&amp;gt;) and is deleted when done (option&amp;lt;code&amp;gt;--rm&amp;lt;/code&amp;gt;)&lt;br /&gt;
 docker run --rm -it -v gitlab-runner-config-projectname:/etc/gitlab-runner gitlab/gitlab-runner:latest register&lt;br /&gt;
&lt;br /&gt;
Follow the instructions and enter URL of GitLab service and registration token, name of the instance and a few other options.&lt;br /&gt;
&lt;br /&gt;
==== Stop docker container ====&lt;br /&gt;
Stop, note that container will not be deleted&lt;br /&gt;
 docker container stop gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
If it should be removed, this needs to be explicitly done (also in one go without stop)&lt;br /&gt;
 docker container rm gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
Can also be restarted&lt;br /&gt;
 docker container stop gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
==== Limit number of cores used by the runner ====&lt;br /&gt;
Use option &amp;lt;code&amp;gt;--cpuset-cpus&amp;lt;/code&amp;gt; to assign dedicated CPUs to the container. There is also an option &amp;lt;code&amp;gt;--cpus&amp;lt;/code&amp;gt; to specify a fraction of cores to be used, but this will not effect the &amp;lt;code&amp;gt;nproc&amp;lt;/code&amp;gt; command in the container.&lt;br /&gt;
&lt;br /&gt;
To utilize all but 2 cores of the host system, e.g. start with the calculated value:&lt;br /&gt;
  cpus=`nproc`; docker run --cpuset-cpus=&amp;quot;0-$((cpus - 3))&amp;quot; ...&lt;br /&gt;
&lt;br /&gt;
In the container, the &amp;lt;code&amp;gt;nproc&amp;lt;/code&amp;gt; command can be used to retrieve the number number of cores, e.g. to pass it to the build system.&lt;br /&gt;
&lt;br /&gt;
=== Importing an external package ===&lt;br /&gt;
The project will use a couple of external packages which are hosted in a different master repository. Copies of such external packages can be added to the gitlab server under our project group to provide a consistent package.&lt;br /&gt;
&lt;br /&gt;
Here is a proposed workflow for importing a package which is already hosted in git.&lt;br /&gt;
# Create new repository in the pCT group or ask for creation, lets call it &#039;&#039;newPackage&#039;&#039;&lt;br /&gt;
# Fork the repository to your user space&lt;br /&gt;
# Clone the package you want to import&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone &amp;lt;some_external_link&amp;gt; newPackage # we give it the new name&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; cd newPackage&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Redirect upstream URL to the fork in your gitlab user space&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git remote set-url origin https://user@gitlab.uib.no/user/newPackage.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Now make a forced push (option &#039;&#039;-f&#039;&#039;) to import the repository to your fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push -f origin&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Create merge request to branch &#039;&#039;import&#039;&#039; (if not existing, &#039;&#039;master&#039;&#039; or any other appropriate branch) by following the instructions [[Documentation#Pull/Merge request | Pull/Merge request]]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Gitlab_Master_FAQ&amp;diff=900</id>
		<title>Gitlab Master FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Gitlab_Master_FAQ&amp;diff=900"/>
		<updated>2021-03-10T09:17:26Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Setup GitLab CI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[Gitlab Master FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for project maintainers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
=== Mirror a repository ===&lt;br /&gt;
GitLab supports mirroring of a repository, the GitLab version provided by UiB supports mirroring by &#039;&#039;push&#039;&#039;. That means, repository content is pushed to another repository.&lt;br /&gt;
&lt;br /&gt;
The set this up&lt;br /&gt;
# Create a R/W repository access token in the target repository&lt;br /&gt;
# In the source repository choose &#039;&#039;&#039;Settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Repository&#039;&#039;&#039; and expand &#039;&#039;&#039;Mirroring repositories&#039;&#039;&#039;&lt;br /&gt;
#: &#039;&#039;&#039;Git repository URL&#039;&#039;&#039;: https://oauth2@git.app.uib.no/group/project&lt;br /&gt;
#: &#039;&#039;&#039;Mirror direction&#039;&#039;&#039;: Push (this is fixed in the current version of GitLab)&lt;br /&gt;
#: &#039;&#039;&#039;Authentication method&#039;&#039;&#039;: Password (this is fixed in the current version of GitLab)&lt;br /&gt;
#: &#039;&#039;&#039;Password&#039;&#039;&#039;: the access token&lt;br /&gt;
# Choose options, whether to prohibit diverging refs, and which branches to mirror. In most cases the mirroring should not be done for all branches but only the protected ones (which represent the stable development).&lt;br /&gt;
# Click &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Mirror repository&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GitLab takes care of automatically pushing changes to mirror repository. Alternatively, update can be triggered from the Web interface&lt;br /&gt;
&lt;br /&gt;
Example link&lt;br /&gt;
    https://oauth2@git.app.uib.no/pct/development/pct-online&lt;br /&gt;
&lt;br /&gt;
== Setup GitLab CI ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring CI ===&lt;br /&gt;
&lt;br /&gt;
=== Add specific runner ===&lt;br /&gt;
The CI is executed by a so-called &#039;&#039;runner&#039;&#039;, usually a GitLab service also provides a few shared runners. As they might be limited in capacity and availability, specific runners can be set up. Specific runners make use of resources you can control.&lt;br /&gt;
&lt;br /&gt;
If you have access to a resources providing &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt;, the runner can be set up with a few lines.&lt;br /&gt;
&lt;br /&gt;
External links in the GitLab documentation&lt;br /&gt;
* [https://docs.gitlab.com/runner/install/docker.html https://docs.gitlab.com/runner/install/docker.html]&lt;br /&gt;
* [https://docs.gitlab.com/runner/register/index.html#docker https://docs.gitlab.com/runner/register/index.html#docker]&lt;br /&gt;
&lt;br /&gt;
==== Launch docker container ====&lt;br /&gt;
Create the docker volume for the configuration of the runner, this volume is mounted in the container executing the runner&lt;br /&gt;
 docker volume create gitlab-runner-config-projectname&lt;br /&gt;
&lt;br /&gt;
Start the runner in a container&lt;br /&gt;
 docker run -d --restart always -v /var/run/docker.sock:/var/run/docker.sock -v gitlab-runner-config-projectname:/etc/gitlab-runner --name gitlab-runner-projectname gitlab/gitlab-runner:latest&lt;br /&gt;
&lt;br /&gt;
==== Register ====&lt;br /&gt;
Launch a container with command &amp;lt;code&amp;gt;register&amp;lt;/code&amp;gt;, the container comes with a pseudo tty connected stdin (options &amp;lt;code&amp;gt;-it&amp;lt;/code&amp;gt;) and is deleted when done (option&amp;lt;code&amp;gt;--rm&amp;lt;/code&amp;gt;)&lt;br /&gt;
 docker run --rm -it -v gitlab-runner-config-projectname:/etc/gitlab-runner gitlab/gitlab-runner:latest register&lt;br /&gt;
&lt;br /&gt;
Follow the instructions and enter URL of GitLab service and registration token, name of the instance and a few other options.&lt;br /&gt;
&lt;br /&gt;
==== Stop docker container ====&lt;br /&gt;
Stop, note that container will not be deleted&lt;br /&gt;
 docker container stop gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
If it should be removed, this needs to be explicitly done (also in one go without stop)&lt;br /&gt;
 docker container rm gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
Can also be restarted&lt;br /&gt;
 docker container stop gitlab-runner-projectname&lt;br /&gt;
&lt;br /&gt;
=== Importing an external package ===&lt;br /&gt;
The project will use a couple of external packages which are hosted in a different master repository. Copies of such external packages can be added to the gitlab server under our project group to provide a consistent package.&lt;br /&gt;
&lt;br /&gt;
Here is a proposed workflow for importing a package which is already hosted in git.&lt;br /&gt;
# Create new repository in the pCT group or ask for creation, lets call it &#039;&#039;newPackage&#039;&#039;&lt;br /&gt;
# Fork the repository to your user space&lt;br /&gt;
# Clone the package you want to import&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone &amp;lt;some_external_link&amp;gt; newPackage # we give it the new name&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; cd newPackage&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Redirect upstream URL to the fork in your gitlab user space&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git remote set-url origin https://user@gitlab.uib.no/user/newPackage.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Now make a forced push (option &#039;&#039;-f&#039;&#039;) to import the repository to your fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push -f origin&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Create merge request to branch &#039;&#039;import&#039;&#039; (if not existing, &#039;&#039;master&#039;&#039; or any other appropriate branch) by following the instructions [[Documentation#Pull/Merge request | Pull/Merge request]]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=899</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=899"/>
		<updated>2021-03-05T07:22:06Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Create access token */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution!&#039;&#039;&#039;: Everybody who has the token can use it, make sure that it does not leak. Usually, tokens are used to allow external apps and tools access to do their job. Such apps store the token as secrets and do not display tokens to the outside.&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible, or better, specify expiration date&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
=== My external user account on GitLab does not give me a namespace for forking ===&lt;br /&gt;
This is a limitation of GitLab, the external users do not get their own namespace and a personal fork is thus not possible.&lt;br /&gt;
&lt;br /&gt;
Instead, you can use a common development fork which is created by the project maintainers in subgroup [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
Get in contact with the maintainers to be added with &#039;&#039;developer&#039;&#039; role.&lt;br /&gt;
&lt;br /&gt;
The standard branches of forks in this namespace will be protected. Developers can push feature branches which should have a name &#039;&#039;user_feature&#039;&#039;.&lt;br /&gt;
Merge requests can be created in the usual way.&lt;br /&gt;
&lt;br /&gt;
=== How can I push a feature branch to the common development fork ===&lt;br /&gt;
If you do not have a personal fork and have cloned from the master repository, you can still push your development in a feature branch to the common development forks in [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
&lt;br /&gt;
# Create feature branch if not yet done, since it will be in a common fork, include user name in the branch name&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git checkout -b user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to common fork&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git push git@git.app.uib.no:pct/development/pct-online.git user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
#* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: be extra careful as you are pushing to a common space, especially with forced push.&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
If you are starting to do changes to a branch, e.g. rebasing and resolving conflicts, it&#039;s good to make a copy of the branch.&lt;br /&gt;
&lt;br /&gt;
Simply create a new branch from the current one, and &lt;br /&gt;
 git branch backup_feature&lt;br /&gt;
&lt;br /&gt;
Once you have done the changes, check if there is any difference to the backup&lt;br /&gt;
 git diff backup_feature&lt;br /&gt;
&lt;br /&gt;
After the work has been finished its advisable to remove the backup branch.&lt;br /&gt;
&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
A branch is deleted using &amp;lt;code&amp;gt;branch&amp;lt;/code&amp;gt;-command with option &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-D&amp;lt;/code&amp;gt;, the latter ignoring the check for loss of content, namely if the branch state is already available in other branches.&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
If the branch is not in sync with some other branch you can do (note the fast-forward merge):&lt;br /&gt;
 git rebase other_branch my_feature&lt;br /&gt;
 git checkout other_branch&lt;br /&gt;
 git merge --ff-only my_feature&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
To delete a branch in the fork, an empty refspec is pushed, here the colon &#039;&#039;&#039;:&#039;&#039;&#039; is important.&lt;br /&gt;
 git push origin :my_feature&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=898</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=898"/>
		<updated>2021-03-05T07:21:32Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Create access token */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution!&#039;&#039;&#039;: Everybody who has the token can use it, make sure that it does not leak. Usually, tokens are used to allo external apps and tools access to do their job. Such apps store the token as secrets and do not display tokens to the outside.&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible, or better, specify expiration date&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
=== My external user account on GitLab does not give me a namespace for forking ===&lt;br /&gt;
This is a limitation of GitLab, the external users do not get their own namespace and a personal fork is thus not possible.&lt;br /&gt;
&lt;br /&gt;
Instead, you can use a common development fork which is created by the project maintainers in subgroup [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
Get in contact with the maintainers to be added with &#039;&#039;developer&#039;&#039; role.&lt;br /&gt;
&lt;br /&gt;
The standard branches of forks in this namespace will be protected. Developers can push feature branches which should have a name &#039;&#039;user_feature&#039;&#039;.&lt;br /&gt;
Merge requests can be created in the usual way.&lt;br /&gt;
&lt;br /&gt;
=== How can I push a feature branch to the common development fork ===&lt;br /&gt;
If you do not have a personal fork and have cloned from the master repository, you can still push your development in a feature branch to the common development forks in [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
&lt;br /&gt;
# Create feature branch if not yet done, since it will be in a common fork, include user name in the branch name&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git checkout -b user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to common fork&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git push git@git.app.uib.no:pct/development/pct-online.git user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
#* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: be extra careful as you are pushing to a common space, especially with forced push.&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
If you are starting to do changes to a branch, e.g. rebasing and resolving conflicts, it&#039;s good to make a copy of the branch.&lt;br /&gt;
&lt;br /&gt;
Simply create a new branch from the current one, and &lt;br /&gt;
 git branch backup_feature&lt;br /&gt;
&lt;br /&gt;
Once you have done the changes, check if there is any difference to the backup&lt;br /&gt;
 git diff backup_feature&lt;br /&gt;
&lt;br /&gt;
After the work has been finished its advisable to remove the backup branch.&lt;br /&gt;
&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
A branch is deleted using &amp;lt;code&amp;gt;branch&amp;lt;/code&amp;gt;-command with option &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-D&amp;lt;/code&amp;gt;, the latter ignoring the check for loss of content, namely if the branch state is already available in other branches.&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
If the branch is not in sync with some other branch you can do (note the fast-forward merge):&lt;br /&gt;
 git rebase other_branch my_feature&lt;br /&gt;
 git checkout other_branch&lt;br /&gt;
 git merge --ff-only my_feature&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
To delete a branch in the fork, an empty refspec is pushed, here the colon &#039;&#039;&#039;:&#039;&#039;&#039; is important.&lt;br /&gt;
 git push origin :my_feature&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=897</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=897"/>
		<updated>2021-03-05T07:21:14Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Create access token */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Caution&#039;&#039;&#039;: Everybody who has the token can use it, make sure that it does not leak. Usually, tokens are used to allo external apps and tools access to do their job. Such apps store the token as secrets and do not display tokens to the outside.&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible, or better, specify expiration date&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
=== My external user account on GitLab does not give me a namespace for forking ===&lt;br /&gt;
This is a limitation of GitLab, the external users do not get their own namespace and a personal fork is thus not possible.&lt;br /&gt;
&lt;br /&gt;
Instead, you can use a common development fork which is created by the project maintainers in subgroup [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
Get in contact with the maintainers to be added with &#039;&#039;developer&#039;&#039; role.&lt;br /&gt;
&lt;br /&gt;
The standard branches of forks in this namespace will be protected. Developers can push feature branches which should have a name &#039;&#039;user_feature&#039;&#039;.&lt;br /&gt;
Merge requests can be created in the usual way.&lt;br /&gt;
&lt;br /&gt;
=== How can I push a feature branch to the common development fork ===&lt;br /&gt;
If you do not have a personal fork and have cloned from the master repository, you can still push your development in a feature branch to the common development forks in [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
&lt;br /&gt;
# Create feature branch if not yet done, since it will be in a common fork, include user name in the branch name&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git checkout -b user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to common fork&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git push git@git.app.uib.no:pct/development/pct-online.git user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
#* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: be extra careful as you are pushing to a common space, especially with forced push.&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
If you are starting to do changes to a branch, e.g. rebasing and resolving conflicts, it&#039;s good to make a copy of the branch.&lt;br /&gt;
&lt;br /&gt;
Simply create a new branch from the current one, and &lt;br /&gt;
 git branch backup_feature&lt;br /&gt;
&lt;br /&gt;
Once you have done the changes, check if there is any difference to the backup&lt;br /&gt;
 git diff backup_feature&lt;br /&gt;
&lt;br /&gt;
After the work has been finished its advisable to remove the backup branch.&lt;br /&gt;
&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
A branch is deleted using &amp;lt;code&amp;gt;branch&amp;lt;/code&amp;gt;-command with option &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-D&amp;lt;/code&amp;gt;, the latter ignoring the check for loss of content, namely if the branch state is already available in other branches.&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
If the branch is not in sync with some other branch you can do (note the fast-forward merge):&lt;br /&gt;
 git rebase other_branch my_feature&lt;br /&gt;
 git checkout other_branch&lt;br /&gt;
 git merge --ff-only my_feature&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
To delete a branch in the fork, an empty refspec is pushed, here the colon &#039;&#039;&#039;:&#039;&#039;&#039; is important.&lt;br /&gt;
 git push origin :my_feature&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=896</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=896"/>
		<updated>2021-03-04T16:20:51Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Commit strategy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab service&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
As a &#039;&#039;&#039;User&#039;&#039;&#039;, you can download  an archive from the GitLab web interface, e. g.  [https://git.app.uib.no/pct/pct-online pct-online],  by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlab&#039;s/Github&#039;s concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
If your account type does not allow for your personal namespace, you can use the common developer fork, see [[GitLab Developer FAQ#My external user account on GitLab does not give me a namespace for forking]].&lt;br /&gt;
&lt;br /&gt;
If you are a very active developer, the common developer fork might not be the right place and we can set up a specific subgroup for you to provide a namespace. Get in contact with the [[Documentation#Mailing lists and collaborative tools | administrators]].&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Gitlab in general provides &#039;&#039;repository mirroring&#039;&#039; for synchronizing different repositories. Mirroring can be done by either &#039;&#039;Push&#039;&#039; or &#039;&#039;Pull&#039;&#039;. The GitLab version hosted at UiB provides only the option to &#039;&#039;Push&#039;&#039; and mirroring can only be set up in the master repository to &#039;&#039;push&#039;&#039; updates a fork. If &#039;&#039;Pull&#039;&#039; was available, each user would be able to setup mirroring. If you want this for your fork, get in contact with the [[Documentation#Mailing lists and collaborative tools | administrators]]. More information can be found in [[Gitlab Master FAQ#Mirror a repository]].&lt;br /&gt;
&lt;br /&gt;
Otherwise, synchronization is done in a local clone or via merge requests as described below.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#::[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork, see [[GitLab Developer FAQ#Select Fast-forward merge]]&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
Changes are added to the local clone by &#039;&#039;committing&#039;&#039;. First one has to define changes to be committed by &#039;&#039;adding&#039;&#039; files.&lt;br /&gt;
&lt;br /&gt;
    git add some_file&lt;br /&gt;
&lt;br /&gt;
Once the files are marked they can be committed&lt;br /&gt;
&lt;br /&gt;
    git commit&lt;br /&gt;
&lt;br /&gt;
This will open an editor to allow for entering a commit message. This message will be in the version control alongside with the actual changes.&lt;br /&gt;
&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
Meaningful commit messages are a powerful resource to keep track and understand the development, and will make it easier to review code changes.&lt;br /&gt;
&lt;br /&gt;
There are some commonly adopted rules&lt;br /&gt;
# Separate subject from body with a blank line&lt;br /&gt;
# Limit the subject line to 50 characters&lt;br /&gt;
# Capitalize the subject line&lt;br /&gt;
# Do not end the subject line with a period&lt;br /&gt;
# Use the imperative mood in the subject line&lt;br /&gt;
# Wrap the body at 72 characters&lt;br /&gt;
# Use the body to explain what and why vs. how&lt;br /&gt;
&lt;br /&gt;
=== Commit strategy ===&lt;br /&gt;
In general it is beneficial to have multiple well described commits with smaller changes instead of one commit with a whole bulk of changes. And there is some advice making it easier on the long run.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Frequency:&#039;&#039;&#039; Make it to your habit to commit as often as possible, better more then less. Commits can be squashed later when you prepare a merge request. By committing frequently you can keep track of intermediate versions, the latest stable version, an isolated bug, to name a few.&lt;br /&gt;
*&#039;&#039;&#039;Atomicity:&#039;&#039;&#039; A commit should include all changes which belong together, e.g. to compile a new executable. Atomicity must be followed when commits are finally prepared for merging to master repository. Every commit in the master repository must represent a compilable snapshot&lt;br /&gt;
*&#039;&#039;&#039;Separation:&#039;&#039;&#039; Separate changes not belonging together and not necessary for an atomic commit. E.g. do pure formatting changes separated from functional changes.&lt;br /&gt;
&lt;br /&gt;
=== Fixup and Squash ===&lt;br /&gt;
If you discovered a little bug or type in a previously committed change it is good to commit this fix right away and isolated from other changes. Use either option &amp;lt;code&amp;gt;--fixup&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--squash&amp;lt;/code&amp;gt; to mark the commit with the intention to squash it into another commit.&lt;br /&gt;
&lt;br /&gt;
 git add the_changed_file&lt;br /&gt;
 git commit --fixup HEAD&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;HEAD&amp;lt;/code&amp;gt;, any other commit can be specified. The commit is created with an automatic message indicating planned fixup/squash. The difference between the two is that for &#039;&#039;squash&#039;&#039; the commit message will not be commented out.&lt;br /&gt;
&lt;br /&gt;
A shortcut if you only have the change to be committed as squash/fixup in the diff:&lt;br /&gt;
 git commit -a --fixup HEAD&lt;br /&gt;
&lt;br /&gt;
=== Amending the commit message ===&lt;br /&gt;
Be picky with your commit messages, if you are not happy with the message of the last commit you can amend it&lt;br /&gt;
 git commit --amend&lt;br /&gt;
&lt;br /&gt;
== Re-ordering and squashing commits - interactive rebase ==&lt;br /&gt;
&#039;&#039;soon to come&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=895</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=895"/>
		<updated>2021-03-04T16:10:42Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Synchronizing developer fork with main repository */ Updating the information on repository mirroring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab service&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
As a &#039;&#039;&#039;User&#039;&#039;&#039;, you can download  an archive from the GitLab web interface, e. g.  [https://git.app.uib.no/pct/pct-online pct-online],  by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlab&#039;s/Github&#039;s concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
If your account type does not allow for your personal namespace, you can use the common developer fork, see [[GitLab Developer FAQ#My external user account on GitLab does not give me a namespace for forking]].&lt;br /&gt;
&lt;br /&gt;
If you are a very active developer, the common developer fork might not be the right place and we can set up a specific subgroup for you to provide a namespace. Get in contact with the [[Documentation#Mailing lists and collaborative tools | administrators]].&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Gitlab in general provides &#039;&#039;repository mirroring&#039;&#039; for synchronizing different repositories. Mirroring can be done by either &#039;&#039;Push&#039;&#039; or &#039;&#039;Pull&#039;&#039;. The GitLab version hosted at UiB provides only the option to &#039;&#039;Push&#039;&#039; and mirroring can only be set up in the master repository to &#039;&#039;push&#039;&#039; updates a fork. If &#039;&#039;Pull&#039;&#039; was available, each user would be able to setup mirroring. If you want this for your fork, get in contact with the [[Documentation#Mailing lists and collaborative tools | administrators]]. More information can be found in [[Gitlab Master FAQ#Mirror a repository]].&lt;br /&gt;
&lt;br /&gt;
Otherwise, synchronization is done in a local clone or via merge requests as described below.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#::[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork, see [[GitLab Developer FAQ#Select Fast-forward merge]]&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
Changes are added to the local clone by &#039;&#039;committing&#039;&#039;. First one has to define changes to be committed by &#039;&#039;adding&#039;&#039; files.&lt;br /&gt;
&lt;br /&gt;
    git add some_file&lt;br /&gt;
&lt;br /&gt;
Once the files are marked they can be committed&lt;br /&gt;
&lt;br /&gt;
    git commit&lt;br /&gt;
&lt;br /&gt;
This will open an editor to allow for entering a commit message. This message will be in the version control alongside with the actual changes.&lt;br /&gt;
&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
Meaningful commit messages are a powerful resource to keep track and understand the development, and will make it easier to review code changes.&lt;br /&gt;
&lt;br /&gt;
There are some commonly adopted rules&lt;br /&gt;
# Separate subject from body with a blank line&lt;br /&gt;
# Limit the subject line to 50 characters&lt;br /&gt;
# Capitalize the subject line&lt;br /&gt;
# Do not end the subject line with a period&lt;br /&gt;
# Use the imperative mood in the subject line&lt;br /&gt;
# Wrap the body at 72 characters&lt;br /&gt;
# Use the body to explain what and why vs. how&lt;br /&gt;
&lt;br /&gt;
=== Commit strategy ===&lt;br /&gt;
In general it is beneficial to have multiple well described commits with smaller changes instead of one commit with a whole bulk of changes. And there is some advice making it easier on the long run.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Frequency:&#039;&#039;&#039; Make it to your habit to commit as often as possible, better more then less. Commits can be squashed later when you prepare a merge request. By committing frequently you can keep track of intermediate versions, the latest stable version, an isolated bug, to name a few.&lt;br /&gt;
*&#039;&#039;&#039;Atomicity:&#039;&#039;&#039; A commit should include all changes which belong together, e.g. to compile a new executable. Atomicity must be followed when commits are finally prepared for merging to master repository. Every commit in the master repository must represent a compilable snapshot&lt;br /&gt;
*&#039;&#039;&#039;Separation:&#039;&#039;&#039; Separate changes not belonging together and not necessary for an atomic commit. E.g. do pure formatting changes separated from functional changes.&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=894</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=894"/>
		<updated>2021-03-04T15:57:16Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Create developer fork */ Adding note on using the common developer fork&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab service&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
As a &#039;&#039;&#039;User&#039;&#039;&#039;, you can download  an archive from the GitLab web interface, e. g.  [https://git.app.uib.no/pct/pct-online pct-online],  by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlab&#039;s/Github&#039;s concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
If your account type does not allow for your personal namespace, you can use the common developer fork, see [[GitLab Developer FAQ#My external user account on GitLab does not give me a namespace for forking]].&lt;br /&gt;
&lt;br /&gt;
If you are a very active developer, the common developer fork might not be the right place and we can set up a specific subgroup for you to provide a namespace. Get in contact with the [[Documentation#Mailing lists and collaborative tools | administrators]].&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in a local clone or via merge reqursts.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#::[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork, see [[GitLab Developer FAQ#Select Fast-forward merge]]&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
Changes are added to the local clone by &#039;&#039;committing&#039;&#039;. First one has to define changes to be committed by &#039;&#039;adding&#039;&#039; files.&lt;br /&gt;
&lt;br /&gt;
    git add some_file&lt;br /&gt;
&lt;br /&gt;
Once the files are marked they can be committed&lt;br /&gt;
&lt;br /&gt;
    git commit&lt;br /&gt;
&lt;br /&gt;
This will open an editor to allow for entering a commit message. This message will be in the version control alongside with the actual changes.&lt;br /&gt;
&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
Meaningful commit messages are a powerful resource to keep track and understand the development, and will make it easier to review code changes.&lt;br /&gt;
&lt;br /&gt;
There are some commonly adopted rules&lt;br /&gt;
# Separate subject from body with a blank line&lt;br /&gt;
# Limit the subject line to 50 characters&lt;br /&gt;
# Capitalize the subject line&lt;br /&gt;
# Do not end the subject line with a period&lt;br /&gt;
# Use the imperative mood in the subject line&lt;br /&gt;
# Wrap the body at 72 characters&lt;br /&gt;
# Use the body to explain what and why vs. how&lt;br /&gt;
&lt;br /&gt;
=== Commit strategy ===&lt;br /&gt;
In general it is beneficial to have multiple well described commits with smaller changes instead of one commit with a whole bulk of changes. And there is some advice making it easier on the long run.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Frequency:&#039;&#039;&#039; Make it to your habit to commit as often as possible, better more then less. Commits can be squashed later when you prepare a merge request. By committing frequently you can keep track of intermediate versions, the latest stable version, an isolated bug, to name a few.&lt;br /&gt;
*&#039;&#039;&#039;Atomicity:&#039;&#039;&#039; A commit should include all changes which belong together, e.g. to compile a new executable. Atomicity must be followed when commits are finally prepared for merging to master repository. Every commit in the master repository must represent a compilable snapshot&lt;br /&gt;
*&#039;&#039;&#039;Separation:&#039;&#039;&#039; Separate changes not belonging together and not necessary for an atomic commit. E.g. do pure formatting changes separated from functional changes.&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=893</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=893"/>
		<updated>2021-03-04T14:58:03Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* How can I delete a branch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
=== My external user account on GitLab does not give me a namespace for forking ===&lt;br /&gt;
This is a limitation of GitLab, the external users do not get their own namespace and a personal fork is thus not possible.&lt;br /&gt;
&lt;br /&gt;
Instead, you can use a common development fork which is created by the project maintainers in subgroup [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
Get in contact with the maintainers to be added with &#039;&#039;developer&#039;&#039; role.&lt;br /&gt;
&lt;br /&gt;
The standard branches of forks in this namespace will be protected. Developers can push feature branches which should have a name &#039;&#039;user_feature&#039;&#039;.&lt;br /&gt;
Merge requests can be created in the usual way.&lt;br /&gt;
&lt;br /&gt;
=== How can I push a feature branch to the common development fork ===&lt;br /&gt;
If you do not have a personal fork and have cloned from the master repository, you can still push your development in a feature branch to the common development forks in [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
&lt;br /&gt;
# Create feature branch if not yet done, since it will be in a common fork, include user name in the branch name&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git checkout -b user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to common fork&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git push git@git.app.uib.no:pct/development/pct-online.git user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
#* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: be extra careful as you are pushing to a common space, especially with forced push.&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
If you are starting to do changes to a branch, e.g. rebasing and resolving conflicts, it&#039;s good to make a copy of the branch.&lt;br /&gt;
&lt;br /&gt;
Simply create a new branch from the current one, and &lt;br /&gt;
 git branch backup_feature&lt;br /&gt;
&lt;br /&gt;
Once you have done the changes, check if there is any difference to the backup&lt;br /&gt;
 git diff backup_feature&lt;br /&gt;
&lt;br /&gt;
After the work has been finished its advisable to remove the backup branch.&lt;br /&gt;
&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
A branch is deleted using &amp;lt;code&amp;gt;branch&amp;lt;/code&amp;gt;-command with option &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-D&amp;lt;/code&amp;gt;, the latter ignoring the check for loss of content, namely if the branch state is already available in other branches.&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
If the branch is not in sync with some other branch you can do (note the fast-forward merge):&lt;br /&gt;
 git rebase other_branch my_feature&lt;br /&gt;
 git checkout other_branch&lt;br /&gt;
 git merge --ff-only my_feature&lt;br /&gt;
 git branch -d my_feature&lt;br /&gt;
&lt;br /&gt;
To delete a branch in the fork, an empty refspec is pushed, here the colon &#039;&#039;&#039;:&#039;&#039;&#039; is important.&lt;br /&gt;
 git push origin :my_feature&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=892</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=892"/>
		<updated>2021-03-04T14:48:20Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* How can I make a backup of a branch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
=== My external user account on GitLab does not give me a namespace for forking ===&lt;br /&gt;
This is a limitation of GitLab, the external users do not get their own namespace and a personal fork is thus not possible.&lt;br /&gt;
&lt;br /&gt;
Instead, you can use a common development fork which is created by the project maintainers in subgroup [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
Get in contact with the maintainers to be added with &#039;&#039;developer&#039;&#039; role.&lt;br /&gt;
&lt;br /&gt;
The standard branches of forks in this namespace will be protected. Developers can push feature branches which should have a name &#039;&#039;user_feature&#039;&#039;.&lt;br /&gt;
Merge requests can be created in the usual way.&lt;br /&gt;
&lt;br /&gt;
=== How can I push a feature branch to the common development fork ===&lt;br /&gt;
If you do not have a personal fork and have cloned from the master repository, you can still push your development in a feature branch to the common development forks in [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
&lt;br /&gt;
# Create feature branch if not yet done, since it will be in a common fork, include user name in the branch name&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git checkout -b user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to common fork&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git push git@git.app.uib.no:pct/development/pct-online.git user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
#* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: be extra careful as you are pushing to a common space, especially with forced push.&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
If you are starting to do changes to a branch, e.g. rebasing and resolving conflicts, it&#039;s good to make a copy of the branch.&lt;br /&gt;
&lt;br /&gt;
Simply create a new branch from the current one, and &lt;br /&gt;
 git branch backup_feature&lt;br /&gt;
&lt;br /&gt;
Once you have done the changes, check if there is any difference to the backup&lt;br /&gt;
 git diff backup_feature&lt;br /&gt;
&lt;br /&gt;
After the work has been finished its advisable to remove the backup branch.&lt;br /&gt;
&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=891</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=891"/>
		<updated>2021-03-04T14:33:38Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* I have a clone of the main repository and want to connect it now to my fork? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
=== My external user account on GitLab does not give me a namespace for forking ===&lt;br /&gt;
This is a limitation of GitLab, the external users do not get their own namespace and a personal fork is thus not possible.&lt;br /&gt;
&lt;br /&gt;
Instead, you can use a common development fork which is created by the project maintainers in subgroup [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
Get in contact with the maintainers to be added with &#039;&#039;developer&#039;&#039; role.&lt;br /&gt;
&lt;br /&gt;
The standard branches of forks in this namespace will be protected. Developers can push feature branches which should have a name &#039;&#039;user_feature&#039;&#039;.&lt;br /&gt;
Merge requests can be created in the usual way.&lt;br /&gt;
&lt;br /&gt;
=== How can I push a feature branch to the common development fork ===&lt;br /&gt;
If you do not have a personal fork and have cloned from the master repository, you can still push your development in a feature branch to the common development forks in [https://git.app.uib.no/pct/development pct/development].&lt;br /&gt;
&lt;br /&gt;
# Create feature branch if not yet done, since it will be in a common fork, include user name in the branch name&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git checkout -b user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to common fork&lt;br /&gt;
#: &amp;lt;pre&amp;gt;git push git@git.app.uib.no:pct/development/pct-online.git user_feature&amp;lt;/pre&amp;gt;&lt;br /&gt;
#* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: be extra careful as you are pushing to a common space, especially with forced push.&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
coming soon&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Gitlab_Master_FAQ&amp;diff=890</id>
		<title>Gitlab Master FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Gitlab_Master_FAQ&amp;diff=890"/>
		<updated>2021-03-04T13:52:56Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Adding instructions how to mirror a repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[Gitlab Master FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for project maintainers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
=== Mirror a repository ===&lt;br /&gt;
GitLab supports mirroring of a repository, the GitLab version provided by UiB supports mirroring by &#039;&#039;push&#039;&#039;. That means, repository content is pushed to another repository.&lt;br /&gt;
&lt;br /&gt;
The set this up&lt;br /&gt;
# Create a R/W repository access token in the target repository&lt;br /&gt;
# In the source repository choose &#039;&#039;&#039;Settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Repository&#039;&#039;&#039; and expand &#039;&#039;&#039;Mirroring repositories&#039;&#039;&#039;&lt;br /&gt;
#: &#039;&#039;&#039;Git repository URL&#039;&#039;&#039;: https://oauth2@git.app.uib.no/group/project&lt;br /&gt;
#: &#039;&#039;&#039;Mirror direction&#039;&#039;&#039;: Push (this is fixed in the current version of GitLab)&lt;br /&gt;
#: &#039;&#039;&#039;Authentication method&#039;&#039;&#039;: Password (this is fixed in the current version of GitLab)&lt;br /&gt;
#: &#039;&#039;&#039;Password&#039;&#039;&#039;: the access token&lt;br /&gt;
# Choose options, whether to prohibit diverging refs, and which branches to mirror. In most cases the mirroring should not be done for all branches but only the protected ones (which represent the stable development).&lt;br /&gt;
# Click &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Mirror repository&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GitLab takes care of automatically pushing changes to mirror repository. Alternatively, update can be triggered from the Web interface&lt;br /&gt;
&lt;br /&gt;
Example link&lt;br /&gt;
    https://oauth2@git.app.uib.no/pct/development/pct-online&lt;br /&gt;
&lt;br /&gt;
=== Importing an external package ===&lt;br /&gt;
The project will use a couple of external packages which are hosted in a different master repository. Copies of such external packages can be added to the gitlab server under our project group to provide a consistent package.&lt;br /&gt;
&lt;br /&gt;
Here is a proposed workflow for importing a package which is already hosted in git.&lt;br /&gt;
# Create new repository in the pCT group or ask for creation, lets call it &#039;&#039;newPackage&#039;&#039;&lt;br /&gt;
# Fork the repository to your user space&lt;br /&gt;
# Clone the package you want to import&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone &amp;lt;some_external_link&amp;gt; newPackage # we give it the new name&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; cd newPackage&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Redirect upstream URL to the fork in your gitlab user space&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git remote set-url origin https://user@gitlab.uib.no/user/newPackage.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Now make a forced push (option &#039;&#039;-f&#039;&#039;) to import the repository to your fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push -f origin&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Create merge request to branch &#039;&#039;import&#039;&#039; (if not existing, &#039;&#039;master&#039;&#039; or any other appropriate branch) by following the instructions [[Documentation#Pull/Merge request | Pull/Merge request]]&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=888</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=888"/>
		<updated>2021-02-23T12:40:33Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Git commits */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab service&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
As a &#039;&#039;&#039;User&#039;&#039;&#039;, you can download  an archive from the GitLab web interface, e. g.  [https://git.app.uib.no/pct/pct-online pct-online],  by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlab&#039;s/Github&#039;s concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in a local clone or via merge reqursts.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#::[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork, see [[GitLab Developer FAQ#Select Fast-forward merge]]&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
Changes are added to the local clone by &#039;&#039;committing&#039;&#039;. First one has to define changes to be committed by &#039;&#039;adding&#039;&#039; files.&lt;br /&gt;
&lt;br /&gt;
    git add some_file&lt;br /&gt;
&lt;br /&gt;
Once the files are marked they can be committed&lt;br /&gt;
&lt;br /&gt;
    git commit&lt;br /&gt;
&lt;br /&gt;
This will open an editor to allow for entering a commit message. This message will be in the version control alongside with the actual changes.&lt;br /&gt;
&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
Meaningful commit messages are a powerful resource to keep track and understand the development, and will make it easier to review code changes.&lt;br /&gt;
&lt;br /&gt;
There are some commonly adopted rules&lt;br /&gt;
# Separate subject from body with a blank line&lt;br /&gt;
# Limit the subject line to 50 characters&lt;br /&gt;
# Capitalize the subject line&lt;br /&gt;
# Do not end the subject line with a period&lt;br /&gt;
# Use the imperative mood in the subject line&lt;br /&gt;
# Wrap the body at 72 characters&lt;br /&gt;
# Use the body to explain what and why vs. how&lt;br /&gt;
&lt;br /&gt;
=== Commit strategy ===&lt;br /&gt;
In general it is beneficial to have multiple well described commits with smaller changes instead of one commit with a whole bulk of changes. And there is some advice making it easier on the long run.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Frequency:&#039;&#039;&#039; Make it to your habit to commit as often as possible, better more then less. Commits can be squashed later when you prepare a merge request. By committing frequently you can keep track of intermediate versions, the latest stable version, an isolated bug, to name a few.&lt;br /&gt;
*&#039;&#039;&#039;Atomicity:&#039;&#039;&#039; A commit should include all changes which belong together, e.g. to compile a new executable. Atomicity must be followed when commits are finally prepared for merging to master repository. Every commit in the master repository must represent a compilable snapshot&lt;br /&gt;
*&#039;&#039;&#039;Separation:&#039;&#039;&#039; Separate changes not belonging together and not necessary for an atomic commit. E.g. do pure formatting changes separated from functional changes.&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=887</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=887"/>
		<updated>2021-02-23T11:37:37Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Update fork using merge request */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab service&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
As a &#039;&#039;&#039;User&#039;&#039;&#039;, you can download  an archive from the GitLab web interface, e. g.  [https://git.app.uib.no/pct/pct-online pct-online],  by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlab&#039;s/Github&#039;s concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in a local clone or via merge reqursts.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue; background:blue; border:solid 2px blue&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#::[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork, see [[GitLab Developer FAQ#Select Fast-forward merge]]&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=886</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=886"/>
		<updated>2021-02-23T11:35:53Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Which rules should I obey for working with the fork? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab-fork-members-illustration.png | 1200px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Select Fast-forward merge&amp;quot;&amp;gt;select &#039;&#039;&#039;Fast-forward merge&#039;&#039;&#039;&amp;lt;/span&amp;gt; for your fork in &amp;lt;code&amp;gt;Settings&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;General&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;MergeRequests&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: [[File:GitLab fork-setting forward-merge.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
coming soon&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=File:GitLab_fork-setting_forward-merge.png&amp;diff=885</id>
		<title>File:GitLab fork-setting forward-merge.png</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=File:GitLab_fork-setting_forward-merge.png&amp;diff=885"/>
		<updated>2021-02-23T11:07:52Z</updated>

		<summary type="html">&lt;p&gt;Mri083: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=884</id>
		<title>GitLab Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_Developer_FAQ&amp;diff=884"/>
		<updated>2021-02-23T08:04:49Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Which rules should I obey for working with the fork? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab Developer FAQ]]&lt;br /&gt;
&lt;br /&gt;
This is a collection of frequently asked Gitlab questions for developers&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;edit&#039;&#039;&#039; this page and &#039;&#039;&#039;add&#039;&#039;&#039; your question, or send email to pCT@uib.no&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys&lt;br /&gt;
&lt;br /&gt;
=== Register SSH key ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;SSH Keys&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/keys https://git.app.uib.no/-/profile/keys])&lt;br /&gt;
# paste public SSH key from your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; folder, something like &amp;lt;code&amp;gt;id_*.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
# select optionally a title and expiration date&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Add&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create access token ===&lt;br /&gt;
# Login to [https://git.app.uib.no https://git.app.uib.no]&lt;br /&gt;
# go to &#039;&#039;&#039;User settings&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Access Tokens&#039;&#039;&#039; ([https://git.app.uib.no/-/profile/personal_access_tokens https://git.app.uib.no/-/profile/personal_access_tokens])&lt;br /&gt;
# Choose name and expiration date and scopes&lt;br /&gt;
# click &amp;lt;span style=&amp;quot;color:white; background:#006400; bold&amp;quot;&amp;gt;Create personal access token&amp;lt;/span&amp;gt;&lt;br /&gt;
# Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
* Create access tokens only for the scope with the minimal access permissions required for your purpose&lt;br /&gt;
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later&lt;br /&gt;
* Unused tokens should be revoked as soon as possible&lt;br /&gt;
&lt;br /&gt;
== Create repository clone ==&lt;br /&gt;
A &#039;&#039;&#039;repository clone&#039;&#039;&#039; is your work copy, it is created using the &amp;lt;code&amp;gt;git clone&amp;lt;/code&amp;gt;-command.&lt;br /&gt;
&lt;br /&gt;
Find the links for the repository to be cloned&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-menu.png|300px]]&lt;br /&gt;
&lt;br /&gt;
=== Clone using SSH ===&lt;br /&gt;
In order to connect to the GitLab service via ssh, an SSH key needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Register SSH key]]&lt;br /&gt;
&lt;br /&gt;
   git clone git@git.app.uib.no:pct/pct-online.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this is an example for the &amp;lt;code&amp;gt;pct-online&amp;lt;/code&amp;gt; repository&lt;br /&gt;
&lt;br /&gt;
=== Clone using Access Token ===&lt;br /&gt;
An access token needs to be configured -&amp;gt; [[Gitlab Developer FAQ#Create access token]]&lt;br /&gt;
&lt;br /&gt;
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;  insert &amp;lt;span style=&amp;quot;color:yellow; background:red; bold&amp;quot;&amp;gt; &#039;&#039;your token number&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with forks ==&lt;br /&gt;
=== What is a fork? ===&lt;br /&gt;
Every logged-in user can access the main repository, however only a small group of administrators has write access. To contribute, a user creates a &#039;&#039;&#039;fork&#039;&#039;&#039; (see [[Documentation#Creating_a_project_fork | here]]) from the repository. This is a repository copy in the GitLab system where a single developer or a group of developers have full access. The fork is created in a user space.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important not to be confused by the terminology. In contrast to the &#039;&#039;&#039;fork&#039;&#039;&#039; which is still a remote repository on the GitLab web service,&lt;br /&gt;
a local copy of the repository is required on the working machine in order to work on the project. This copy is referred to be a &#039;&#039;&#039;clone&#039;&#039;&#039; (see [[Documentation#Making_local_working_copy | here]]).&lt;br /&gt;
&lt;br /&gt;
=== How do I create a project fork? ===&lt;br /&gt;
A &#039;&#039;project fork&#039;&#039; or &#039;&#039;repository fork&#039;&#039; is a copy of the original repository where a user or a group of users has/have full control. All development in our project is carried out in the individual forks. Branches of project forks are merged back into the main repository by &#039;&#039;&#039;merge requests&#039;&#039;&#039;, preferably via &#039;&#039;&#039;fast forward&#039;&#039;&#039; merges. That requires developers to rebase project forks to the main repository and resolve all conflicts before requesting a merge.&lt;br /&gt;
&lt;br /&gt;
See the external link [https://docs.gitlab.com/ce/gitlab-basics/fork-project.html How to fork a project] for some general introduction.&lt;br /&gt;
&lt;br /&gt;
In the pCT project you can create a fork of all the main repositories in the [https://git.app.uib.no/pct GitLab pct group] by clicking the &#039;&#039;&#039;fork&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-fork-button.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; is an example, replace by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
=== Which rules should I obey for working with the fork? ===&lt;br /&gt;
Your repository fork is your sandbox, you can do whatever you want. Still its good to follow some rules, unless you have your own rules at hand right now, you can apply the following:&lt;br /&gt;
* leave the &#039;&#039;master&#039;&#039; branch in sync with the main repository, do not make commits to it&lt;br /&gt;
* commit your changes to the &#039;&#039;dev&#039;&#039; branch&lt;br /&gt;
* if you start a new feature, and it&#039;s expected to take a while, make a &#039;&#039;feature&#039;&#039; branch, e.g. &#039;&#039;dev-feature&#039;&#039; and give the feature a name&lt;br /&gt;
* synchronize regularly to the main repository by rebasing (tutorial coming soon)&lt;br /&gt;
* add your colleagues as developers to share the code with them. To simply allow read access for the project members add group &#039;&#039;&#039;pct&#039;&#039;&#039; with &#039;&#039;Reporter&#039;&#039;-role.&lt;br /&gt;
&lt;br /&gt;
[[File:GitLab-fork-members-illustration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== How can I make a clone of a project in my fork? ===&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* refer to [[GitLab Developer FAQ#Clone SSH Key]] and [[GitLab Developer FAQ#Clone using Access Token]] for further details.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git clone git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== I have a clone of the main repository and want to connect it now to my fork? ===&lt;br /&gt;
This is a typical situation. You got a clone of some repository and while using it, you started developing. Now you need to connect the clone with the fork you want to use for contributing to the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* All the examples are using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;, refer to [[GitLab Developer FAQ#Clone using Access Token]] and adjust accordingly.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check the remotes of your repository&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
Should show you something like&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;origin&#039;&#039; should refer to your development proxy, we first rename the current &#039;&#039;origin&#039;&#039; to &#039;&#039;upstream&#039;&#039;:&lt;br /&gt;
 git remote rename origin upstream&lt;br /&gt;
&lt;br /&gt;
Add the fork as the new &#039;&#039;origin&#039;&#039;:&lt;br /&gt;
 git remote add origin git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
Synchronize with the fork&lt;br /&gt;
 git remote update&lt;br /&gt;
&lt;br /&gt;
Make your branches to track the branches of your fork, e.g. for the &#039;&#039;dev&#039;&#039; branch:&lt;br /&gt;
 git checkout dev&lt;br /&gt;
 git branch --set-upstream-to origin/dev&lt;br /&gt;
&lt;br /&gt;
Check the remotes:&lt;br /&gt;
 git remote -v&lt;br /&gt;
&lt;br /&gt;
With new result:&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (fetch)&lt;br /&gt;
    origin	git@git.app.uib.no:User.Space/pct-online.git (push)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (fetch)&lt;br /&gt;
    upstream	git@git.app.uib.no:pct/pct-online.git (push)&lt;br /&gt;
&lt;br /&gt;
== Working with clones ==&lt;br /&gt;
=== How many clones can I have? ===&lt;br /&gt;
Since a clone is just a local copy, you can have as many as you want. This is useful if you need to do some testing in a fresh repository or on a different machine.&lt;br /&gt;
&lt;br /&gt;
=== How can I change the upstream link? ===&lt;br /&gt;
A &#039;&#039;remote&#039;&#039; has a name in the git clone, the default name is often &#039;&#039;origin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;User.Space&#039;&#039;&#039;&amp;lt;/span&amp;gt; needs to be replaced by your user space, see the link in the web interface.&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you are using a different &#039;&#039;name&#039;&#039;, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote set-url &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;origin&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;User.Space&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
&lt;br /&gt;
=== Can I have more than one upstream repository ===&lt;br /&gt;
Yes, as a more advanced option, multiple remote repositories can be added to the clone. All remote repositories are referenced through their &#039;&#039;names&#039;&#039;, e.g. &#039;&#039;origin&#039;&#039; pointing to the fork and  &#039;&#039;upstream&#039;&#039; pointing to main repository. this is the recommended setup to work with both the developer fork and synchronize it to the main repository.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;&lt;br /&gt;
* The example is using &#039;&#039;&#039;access via SSH&#039;&#039;&#039;&lt;br /&gt;
* To add the fork of a colleague, replace &amp;lt;span style=&amp;quot;color:yellow; background:red&amp;quot;&amp;gt;&#039;&#039;&#039;pct&#039;&#039;&#039;&amp;lt;/span&amp;gt; by appropriate user space&lt;br /&gt;
* Replace &amp;lt;span style=&amp;quot;color:white; background:green&amp;quot;&amp;gt;&#039;&#039;&#039;pct-online&#039;&#039;&#039;&amp;lt;/span&amp;gt; by repository you are working with.&lt;br /&gt;
* If you want a different name, replace &amp;lt;span style=&amp;quot;color:white; background:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; accordingly&lt;br /&gt;
* After adding the new repository you need to update the remote.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Procedure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 git remote add &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt; git@git.app.uib.no:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;pct&amp;lt;/span&amp;gt;/&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;pct-online&amp;lt;/span&amp;gt;.git&lt;br /&gt;
 git remote update &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;upstream&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I publish new development in my fork ===&lt;br /&gt;
All work you are doing with git is primarily within the local clone. Only by &#039;&#039;pushing&#039;&#039; updates to the remote repository you make it available for others.&lt;br /&gt;
&lt;br /&gt;
Once you have added commits to e.g. the &#039;&#039;&#039;dev&#039;&#039;&#039; branch, those commits can be &#039;&#039;pushed&#039;&#039; upstream to the fork (if &#039;&#039;origin&#039;&#039; refers to the fork)&lt;br /&gt;
 git push origin dev&lt;br /&gt;
&lt;br /&gt;
Or for a feature branch&lt;br /&gt;
 git push origin dev-cool-feature&lt;br /&gt;
&lt;br /&gt;
This will create a remote branch in the remote repository if not yet there, the corresponding branch in the clone will be set up to &#039;&#039;track&#039;&#039; the remote branch.&lt;br /&gt;
If you have pushed earlier to the remote branch and meanwhile have changed the commit history - a fully valid procedure for development branches - the tip of the remote branch and the local branch have different commit history and you can not add additional commits by simply pushing to the remote. In this case, a &#039;&#039;forced&#039;&#039; update is needed and the remote branch is set to the commit history of the local branch. Everything not common will be lost in the remote.&lt;br /&gt;
 git push &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;-f&#039;&#039;&#039;&amp;lt;/span&amp;gt; origin dev&lt;br /&gt;
&lt;br /&gt;
=== How can I make a backup of a branch ===&lt;br /&gt;
coming soon&lt;br /&gt;
=== How do I update a branch after fulfilled merge request? ===&lt;br /&gt;
=== How can I delete a branch ===&lt;br /&gt;
&lt;br /&gt;
== Merge request ==&lt;br /&gt;
All updates to the main repository are made via &#039;&#039;merge requests&#039;&#039; (github refers to them as &#039;&#039;pull requests&#039;&#039;). A merge request requires the code update to be in a mergable branch in a development fork.&lt;br /&gt;
&lt;br /&gt;
Merge request are also used widely to share &#039;&#039;work-in-progress&#039;&#039; with your colleagues and for code reviews. Mark such Merge request with &amp;quot;&#039;&#039;&#039;WIP:&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
In order to avoid conflicts, first the fork has to be updated to the main repository. The idea behind this is that all potential conflicts can be resolved by the developer with the best knowledge about the matter, while the maintainer can simple merge &#039;&#039;fast-forward&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This description expects &#039;&#039;origin&#039;&#039; pointing to the developers fork. All contributions are done to branch &#039;&#039;dev&#039;&#039;, thus it must be updated with the latest version of branch &#039;&#039;dev&#039;&#039; of main repository.&lt;br /&gt;
&lt;br /&gt;
# Fetch update from main repository&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* the update is now stored in the local index, we have fetched branch &#039;&#039;dev&#039;&#039; of the main repository&lt;br /&gt;
#:* check the log of this latest fetch&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git log FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* FETCH_HEAD is a shorthand for the head of the last branch fetched and is valid only immediately after a fetch operation&lt;br /&gt;
# Rebase your development to the main repository, &#039;&#039;rebase&#039;&#039; means that all the new commits are done with respect to the tip of the specified branch. There can be &#039;&#039;merge conflicts&#039;&#039; which need to be resolved with appropriate changes and commits.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* keep in mind that FETCH_HEAD is only temporarily valid, so you should do this immediately after &#039;&#039;fetch&#039;&#039; (&#039;&#039;log&#039;&#039; does not change anything)&lt;br /&gt;
#:* replace &#039;&#039;dev&#039;&#039; with appropriate branch name if other then &#039;&#039;dev&#039;&#039; is used; it is also possible to rebase a branch with other name to the remote branch, e.g.&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git rebase FETCH_HEAD feature-name&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Check your commits and commit messages, eventually &#039;&#039;squash&#039;&#039; (combine) or &#039;&#039;reword&#039;&#039;. This advanced option is described later.&lt;br /&gt;
# Push to fork. As the commit history has most likely been changed, the option &#039;&#039;-f&#039;&#039; (force) has to be used&lt;br /&gt;
#: &amp;lt;pre&amp;gt; git push -f origin dev &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The branch &#039;&#039;dev&#039;&#039; in the fork is now ready for a merge request. The branch name can be adjusted, there is nothing preventing other branch names.&lt;br /&gt;
&lt;br /&gt;
==== Example workflow for a Merge request ====&lt;br /&gt;
# Go to your gitlab user space at [https://git.app.uib.no/User.Space] (replace &#039;&#039;User.Space&#039;&#039; appropriately).&lt;br /&gt;
# Find the project fork, e.g. in the list of projects associated with you from the upper main menu.&lt;br /&gt;
# In the line with the many columns regarding the repository, click on the &amp;quot;+&amp;quot;-symbol on the right hand side and choose &amp;quot;New merge request&amp;quot;&lt;br /&gt;
# Select project and branch for both source and target, and click &amp;quot;Compare branches and continue&amp;quot;. &#039;&#039;&#039;Remember&#039;&#039;&#039;: in almost all cases you have to merge to branch &#039;&#039;dev&#039;&#039; or other feature branch, only in very rare cases to branch &#039;&#039;master&#039;&#039;&lt;br /&gt;
# Review the list of commits in this merge request, give it a descriptive title and description, pick an assignee&lt;br /&gt;
# Submit the merge request&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=883</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=883"/>
		<updated>2021-02-23T08:01:37Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* The developer fork */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab service&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
As a &#039;&#039;&#039;User&#039;&#039;&#039;, you can download  an archive from the GitLab web interface, e. g.  [https://git.app.uib.no/pct/pct-online pct-online],  by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlab&#039;s/Github&#039;s concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in a local clone or via merge reqursts.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#:[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork.&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=882</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=882"/>
		<updated>2021-02-23T08:00:14Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Terminology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab service&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
As a &#039;&#039;&#039;User&#039;&#039;&#039;, you can download  an archive from the GitLab web interface, e. g.  [https://git.app.uib.no/pct/pct-online pct-online],  by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlabs/Githubs concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in a local clone or via merge reqursts.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#:[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork.&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=881</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=881"/>
		<updated>2021-02-23T07:55:52Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Roles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab server system&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
As a &#039;&#039;&#039;User&#039;&#039;&#039;, you can download  an archive from the GitLab web interface, e. g.  [https://git.app.uib.no/pct/pct-online pct-online],  by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlabs/Githubs concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in a local clone or via merge reqursts.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#:[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork.&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=880</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=880"/>
		<updated>2021-02-22T16:15:20Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* Update fork using merge request */ Adding an illustration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab server system&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
From the GitLab web interface [https://git.app.uib.no/pct/pct-online pct-online], an archive can be downloaded by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlabs/Githubs concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in a local clone or via merge reqursts.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
#:[[File:Git-fork-update-by-merge-request.png]]&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare branches and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork.&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=File:Git-fork-update-by-merge-request.png&amp;diff=879</id>
		<title>File:Git-fork-update-by-merge-request.png</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=File:Git-fork-update-by-merge-request.png&amp;diff=879"/>
		<updated>2021-02-22T16:14:41Z</updated>

		<summary type="html">&lt;p&gt;Mri083: Mri083 uploaded a new version of File:Git-fork-update-by-merge-request.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=File:Git-fork-update-by-merge-request.png&amp;diff=878</id>
		<title>File:Git-fork-update-by-merge-request.png</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=File:Git-fork-update-by-merge-request.png&amp;diff=878"/>
		<updated>2021-02-22T16:11:58Z</updated>

		<summary type="html">&lt;p&gt;Mri083: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=877</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=877"/>
		<updated>2021-02-22T16:02:10Z</updated>

		<summary type="html">&lt;p&gt;Mri083: /* The developer fork */ Clarifying recipe to update fork&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab server system&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
From the GitLab web interface [https://git.app.uib.no/pct/pct-online pct-online], an archive can be downloaded by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlabs/Githubs concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Create developer fork ===&lt;br /&gt;
The fork can be created from the GitLab web interface by simply clicking on the &#039;&#039;&#039;Fork&#039;&#039;&#039;-button, see [[GitLab Developer FAQ#How do I create a project fork?]] for details.&lt;br /&gt;
&lt;br /&gt;
To make the development within the project more coherent, you should follow a couple of [[GitLab Developer FAQ#Which rules should I obey for working with the fork? | rules under this link]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the master repository is not public, also your fork won&#039;t be public and you have to allow your colleagues to access it, see in the rules above.&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in a local clone or via merge reqursts.&lt;br /&gt;
&lt;br /&gt;
In fact, the matter is not so easy in itself as there can be conflicting developments in the master repository and your development fork.&lt;br /&gt;
&lt;br /&gt;
The primary goal of the update is to move the head of a branch in the development fork forward in the sequence of commits, from one point in the commit history to a another one. If the branch to be updated has already new commits, meaning the commit histories have diverged, all these commits should be applied to the new point in the history. Its important to note, that no additional commits are created in this process. This procedure is called &#039;&#039;rebase&#039;&#039; as we put the commits or a branch position to a &#039;&#039;new base&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Update fork using local clone ====&lt;br /&gt;
A sample sequence for updating a fork of the pct-online repository, assuming the local clone is set up already (see [[GitLab Developer FAQ#How can I make a clone of a project in my fork?]]).&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch git@git.app.uib.no:pct/pct-online.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:or if you have configured the upstream &lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch upstream dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Update fork using merge request ====&lt;br /&gt;
Another way of updating the developer fork is through a reverse merge request from the master repository to the developer fork, &#039;&#039;reverse&#039;&#039; in the sense that the flow of contributions is usually in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we only want fast-forward merges in this case, this can not be done if the source branch is not a direct continuation of the target branch, i.e. new commits are present. Do the rebase in the local clone in such a case.this case.&lt;br /&gt;
# Open the GitLab web interface for the repository&lt;br /&gt;
# In the tool bar at the top click &amp;lt;span style=&amp;quot;color:blue; background:while; border:solid 2px blue&amp;quot;&amp;gt;&#039;&#039;&#039;+&#039;&#039;&#039;&amp;lt;/span&amp;gt; and &#039;&#039;&#039;New merge request&#039;&#039;&#039; in the drop-down menu&lt;br /&gt;
#:Note: you can not go via &amp;lt;code&amp;gt;Merge Requests&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;Create merge request&amp;lt;/code&amp;gt; because this will redirect to your developer fork and you can not select the master repository as source from there.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; branch of the master repository as source&lt;br /&gt;
# Select your developer fork as target and choose branch to be updated&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Compare and continue&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# Set a title, e.g. &amp;quot;Updating dev branch from master repository&amp;quot;, check once again that the source is the master repository and the target your developer fork&lt;br /&gt;
# Take the occasion to check what has happened since your last update and scroll through the new commits&lt;br /&gt;
# Press &amp;lt;span style=&amp;quot;color:white; background:green; border:solid 2px green&amp;quot;&amp;gt;&#039;&#039;&#039;Submit merge request&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
# The web interface will redirect to your developer fork, the CI pipeline is started&lt;br /&gt;
# Once the CI succeeds, merge &#039;&#039;&#039;by fast-forward&#039;&#039;&#039; - Important &#039;&#039;&#039;DO NOT MERGE BY CREATING MERGE COMMITS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the option to merge by fast-forward is not displayed, this needs to be changed in the project settings of the developer fork.&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=876</id>
		<title>GitLab best practice</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=GitLab_best_practice&amp;diff=876"/>
		<updated>2021-02-22T14:10:19Z</updated>

		<summary type="html">&lt;p&gt;Mri083: small corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Documentation]] -&amp;gt; [[GitLab best practice]]&lt;br /&gt;
&lt;br /&gt;
This page is summarizing guidelines how to use Gitlab within the project. Some general information how to work with GitLab can be found under the following&lt;br /&gt;
external links:&lt;br /&gt;
* [https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected/ Tutorial: It&#039;s all connected in GitLab]&lt;br /&gt;
* [https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/ GitLab workflow overview]&lt;br /&gt;
* [https://about.gitlab.com/2014/09/29/gitlab-flow/ What is GitLab Flow?]&lt;br /&gt;
&lt;br /&gt;
GitLab is a web service for &#039;&#039;&#039;git&#039;&#039;&#039;, the &#039;&#039;stupid content tracker&#039;&#039; (according to its [https://manpages.debian.org/stretch/git-man/git.1.en.html man page]).&lt;br /&gt;
Git implements distributed repositories, git itself does not even make an assumption about a master repository. It is however good to have such a master repository and dedicated strategy how to contribute to it.&lt;br /&gt;
This is, where GitLab enters the scene. The web service is hosting remote repositories and implements procedures for synchronization and content merging.&lt;br /&gt;
&lt;br /&gt;
In the pCT project we have master repositories for different sub-projects. Check the repositories in the [https://git.app.uib.no/pct GitLab pCT group].&lt;br /&gt;
&lt;br /&gt;
In this description, we are using the [https://git.app.uib.no/pct/pct-online  pct-online] repository as an example.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
When working with git/GitLab, you will meet a few terms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;branch&#039;&#039;&#039;: the tip of a sequence of commits, branches share a common history and develop independently from one point in the history&lt;br /&gt;
* &#039;&#039;&#039;merge&#039;&#039;&#039;: two branches are brought together and the result commited with a new commit&lt;br /&gt;
* &#039;&#039;&#039;rebase&#039;&#039;&#039;: the history of a branch is applied to another branch resulting into a new history containing the commits of both branches&lt;br /&gt;
* &#039;&#039;&#039;fork&#039;&#039;&#039;: repository copy in a user space of GitLab server system&lt;br /&gt;
* &#039;&#039;&#039;clone&#039;&#039;&#039;: local working copy on a machine&lt;br /&gt;
&lt;br /&gt;
== Default branch structure ==&lt;br /&gt;
The main repository has the following branches:&lt;br /&gt;
* &#039;&#039;&#039;production&#039;&#039;&#039;: the latest production code, in this branch we have release tags&lt;br /&gt;
* &#039;&#039;&#039;master&#039;&#039;&#039;: the latest stable release&lt;br /&gt;
* &#039;&#039;&#039;dev&#039;&#039;&#039;: the development branch&lt;br /&gt;
&lt;br /&gt;
Note that we are currently only using the &#039;&#039;&#039;dev&#039;&#039;&#039; branch. The &#039;&#039;&#039;production&#039;&#039;&#039; and &#039;&#039;&#039;master&#039;&#039;&#039; branches will be populated while we are progressing with the development.&lt;br /&gt;
&lt;br /&gt;
In addition to those main branches there can be &#039;&#039;feature&#039;&#039; branches where development happens detached from the main branches. A &#039;&#039;feature&#039;&#039; branch is based on the &#039;&#039;dev&#039;&#039; branch and has a limited lifetime.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
There are two very different use cases, the&lt;br /&gt;
# &#039;&#039;&#039;User role&#039;&#039;&#039;: A &#039;&#039;user&#039;&#039; wants to download the code, compile it and use it.&lt;br /&gt;
# &#039;&#039;&#039;Developer role&#039;&#039;&#039;: A &#039;&#039;developer&#039;&#039; contributes to the development. &lt;br /&gt;
&lt;br /&gt;
From the GitLab web interface [https://git.app.uib.no/pct/pct-online pct-online], an archive can be downloaded by clicking the download symbol like in this screen shot.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-download-button.png]]&lt;br /&gt;
&lt;br /&gt;
However, even if you think you are fitting best into the user role, you might end up faster than you expect coding and changing the project files. Having content management in place right from the beginning is thus a good idea and it is recommended to use the code by creating a &#039;&#039;&#039;clone&#039;&#039;&#039; of the repository.&lt;br /&gt;
&lt;br /&gt;
[[File:Pct-online-clone-button.png]]&lt;br /&gt;
&lt;br /&gt;
See [[Gitlab Developer FAQ#Create repository clone]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== The developer fork ==&lt;br /&gt;
The &#039;&#039;developer fork&#039;&#039; is the main feature in Gitlabs/Githubs concept of distributed development, code sharing and code review.&lt;br /&gt;
&lt;br /&gt;
=== Synchronizing developer fork with main repository ===&lt;br /&gt;
&#039;&#039;&#039;This should be done regularly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is unfortunately no simple synchronization feature for forks within Gitlab (from Gitlab Enterprise Edition 8.2 &#039;&#039;repository mirroring&#039;&#039; is provided). Synchronization is done in the local clone.&lt;br /&gt;
# Fetch branch from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/pct/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Rebase local branch&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git rebase FETCH_HEAD dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push to fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Git commits ==&lt;br /&gt;
=== Log message format ===&lt;br /&gt;
&lt;br /&gt;
== Handling merge requests ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;This section will be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Git allows for two merging strategies, the &#039;&#039;normal&#039;&#039; and &#039;&#039;fast-forward (ff)&#039;&#039;  merging. The &#039;&#039;normal&#039;&#039; merging adds a &#039;&#039;merge commit&#039;&#039;. This adds additional information, when something has been merged. In contrast to that, the latter requires to synchronize the branch to be merged via rebasing, and does not need a merge commit. This results in a linear commit history (not necessarily in time). Whether to use the one or the other depends on the specific case and taste. Many people prefer a linear commit history. As a rule of thumb one can say:&lt;br /&gt;
* a relatively small and timely update should be done via ff merge&lt;br /&gt;
* big developments outside of the main development tree should be merged with merge commits. This allows also for detailed commit messages.&lt;br /&gt;
&lt;br /&gt;
=== Automatic merges ===&lt;br /&gt;
Gitlab offers the possibility to initiate the merge of a Merge Request (MR) directly from the Web interface. This is very easy and straight forward, however in the Gitlab Community Edition provided by UiB IT, the &#039;&#039;normal merge&#039;&#039; procedure is used. As a consequence, every Gitlab Merge Request initiated from the Web interface will include a merge commit.&lt;br /&gt;
&lt;br /&gt;
=== Fast-forward merges ===&lt;br /&gt;
Fast-forward merges do in contrast to normal git (and Gitlab) merges not produce a separate merge commit. Gitlab Enterprise Edition offers the feature to use fast-forward merges directly from the Gitlab Web interface. UiB IT is providing Gitlab Community Edition, so we do not have this convenient feature right away.&lt;br /&gt;
&lt;br /&gt;
==== Why fast-forward merges? ====&lt;br /&gt;
Many people consider a linear commit history as an advantage, i.e. not to have merge commits for every merge.&lt;br /&gt;
A fast-forward merge can be done if only the branch to be merged has additional commits on top of the common commit history. The merge simply means to forward the tip of the target branch.&lt;br /&gt;
&lt;br /&gt;
==== Workflow ====&lt;br /&gt;
As Gitlab does not provide the functionality, the merge needs to be done outside Gitlab in a &#039;&#039;&#039;local clone from the master repository&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the workflow below&lt;br /&gt;
* adjust the project name &#039;&#039;wpn&#039;&#039;&lt;br /&gt;
* adjust the &#039;&#039;user&#039;&#039;&lt;br /&gt;
* adjust the branch name&lt;br /&gt;
* you can skip the cloning if you have a already a clone&lt;br /&gt;
&lt;br /&gt;
Workflow for merging the dev brach from a user fork&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Recipe going to be updated soon&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Make a local clone from the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git clone https://gitlab.uib.no/pct/wpn.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:* or update an existing clone&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git checkout dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git pull --ff-only origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Fetch branch &#039;&#039;dev&#039;&#039; from user fork&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git fetch https://gitlab.uib.no/user/wpn.git dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Merge alias &#039;&#039;FETCH_HEAD&#039;&#039;&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git merge --ff-only FETCH_HEAD&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Push the update to the master repository&lt;br /&gt;
#:&amp;lt;pre&amp;gt; git push origin dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab will &#039;&#039;&#039;automatically&#039;&#039;&#039; recognize that the merge request was merged manually and will &#039;&#039;&#039;close&#039;&#039;&#039; it.&lt;/div&gt;</summary>
		<author><name>Mri083</name></author>
	</entry>
</feed>