Difference between revisions of "GitLab"

From Cncz
Jump to: navigation, search
m
 
(35 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== About GitLab ==
 
== About GitLab ==
[[Bestand:gitlab.png|thumb|alt=GitLab logo|GitLab]]
+
[[Bestand:gitlabnewlogo.png|thumb|alt=GitLab logo|GitLab]]
 
Quote from the [https://about.gitlab.com/features/ GitLab website]
 
Quote from the [https://about.gitlab.com/features/ GitLab website]
 
<blockquote>GitLab is an incredibly powerful open source code collaboration platform, git repository manager, issue tracker and code reviewer.</blockquote>
 
<blockquote>GitLab is an incredibly powerful open source code collaboration platform, git repository manager, issue tracker and code reviewer.</blockquote>
  
 
Our gitlab service is facing the public internet. Meaning you don't need to make use of a VPN tunnel to use it.
 
Our gitlab service is facing the public internet. Meaning you don't need to make use of a VPN tunnel to use it.
 +
 +
== Changes ==
 +
* 2019-01-25 GitLab updated to version 11.7.0 and moved to a new Ubuntu 18.04 server. You might encounter an SSH prompt when pushing or pulling code. The current ssh fingerprints are:
 +
256 SHA256:iWfwGvGZ/hdFImBzzG5Bu/y5gqhUkLOdSTYmzl1+k2w root@gitlab7 (ED25519)
 +
2048 SHA256:lWWFUfhwODG0bBuQJUR8ymlVfqpNHrXk0xbFAoDpTIg root@emoe (RSA)
 +
256 SHA256:pBFiBobAQTozB0xeeMCp3Du2PFtX7YIXw6XRFJSAGH0 root@gitlab7 (ECDSA)
 +
 +
* 2016-09-13 Configured reply by email. You can now simply reply by email to gitlab mail notifications.
 +
* 2016-07-18 Setup [[GitLab#Git_and_managing_large_files|GitLab LFS]] (Large File Storage).
 +
 +
== Maintenance window ==
 +
Updates to GitLab are usually done on Friday mornings. The upgrade procedure consists of:
 +
* blocking ssh and http access
 +
* perform a backup
 +
* upgrade GitLab
 +
* test
 +
* restore ssh and http access
 +
and can take up to 1 hour.
  
 
== Logging in ==
 
== Logging in ==
Line 15: Line 33:
 
* Science login - for students and employees of the Science Faculty. Use your [[Login|Science login]].
 
* Science login - for students and employees of the Science Faculty. Use your [[Login|Science login]].
 
* Standard - for external users.
 
* Standard - for external users.
 +
 +
== Science login ==
 +
Although anyone with a [[Login|Science Login]] can login to GitLab, only people that have actually logged in to GitLab will be visible for other GitLab users. Keep that in mind when adding people to projects or groups.
 +
 +
== Git and managing large files ==
 +
As of July 18th 2016, LFS (Large File Storage) support is enabled on the GitLab server. Git LFS allows you to manage version control on large files without storing them in the git repository. Please refer to the [https://git-lfs.github.com/ Git LFS project website] for more information. Be aware that git-lfs works with the https transport layer (not ssh). However, since version 8.12, it's a lot easier to use:
 +
:Note: With 8.12 GitLab added LFS support to SSH. The Git LFS communication still goes over HTTP, but now the SSH client passes the correct credentials to the Git LFS client, so no action is required by the user. (source [https://docs.gitlab.com/ee/workflow/lfs/manage_large_binaries_with_git_lfs.html#known-limitations GitLab Documentation: Git LFS])
  
 
== External users ==
 
== External users ==
Since projects are usually not restricted to employees or students of the Science Faculty, our GitLab service allows external users as well. Unlike our Subversion web application, GitLab does not provide a way of creating external accounts by users without the 'administrator' role. If you wish to add external users to your GitLab project, please send a request to postmaster@science.ru.nl, mentioning the following details:
+
Since projects are usually not restricted to employees or students of the Science Faculty, our GitLab service allows external users as well. If you wish to add external users to your GitLab project, please send a request to postmaster@science.ru.nl, mentioning the following details:
 
* '''Desired login name''' - We'll prefix it with an underscore by means of avoiding collisions with our existing and future Science logins.
 
* '''Desired login name''' - We'll prefix it with an underscore by means of avoiding collisions with our existing and future Science logins.
 
* '''Full name''' - This is how you'll find the user in the GitLab system. For example, when adding the account to your project.
 
* '''Full name''' - This is how you'll find the user in the GitLab system. For example, when adding the account to your project.
 
* '''Mail address'''. GitLab will use this mail address to send an automatically generated mail with instructions to set a password.
 
* '''Mail address'''. GitLab will use this mail address to send an automatically generated mail with instructions to set a password.
  
As soon as Postmaster created the account, you should be able to add the external login as a member your project. We're not yet sure wather external users should have the option to create projects, so the project limit for external users are set to 0 initially. Depending on the kind of work flow (gitlab merge requests, etc), it might be necessary to give external users the option to create one or more projects.
+
As soon as Postmaster created the account, you should be able to add the external login as a member your project. We're not yet sure whether external users should have the option to create projects, so the project limit for external users is set to 0 initially. Depending on the kind of work flow (gitlab merge requests, etc), it might be necessary to give external users the option to create one or more projects.
  
 
Ideally, postmaster should not be 'in the loop' and users with a Science login should be able to create external user accounts themselves, however [https://gitlab.com/gitlab-org/gitlab-ce/issues/1051 there seems to be a bug in the GitLab API] that prevents us from setting this up.
 
Ideally, postmaster should not be 'in the loop' and users with a Science login should be able to create external user accounts themselves, however [https://gitlab.com/gitlab-org/gitlab-ce/issues/1051 there seems to be a bug in the GitLab API] that prevents us from setting this up.
Line 30: Line 55:
 
* [http://doc.gitlab.com/ce/ General GitLab documentation]
 
* [http://doc.gitlab.com/ce/ General GitLab documentation]
  
== Migrating from Subversion ==
 
Inspired by [https://gist.github.com/leftclickben/322b7a3042cbe97ed2af this short manual], an SVN to git conversion could boil down to something like:
 
  
 +
== Keyboard shortcuts ==
 +
Press '''?''' to display all available keyboard shortcuts!
 +
 +
 +
== Instructions displayed when creating a new project ==
 +
Just copied them over here, because these instructions are only displayed when your project does not yet contain any files.
 +
 +
Git global setup
 +
<syntaxhighlight lang="bash">
 +
$ git config --global user.name "Your Name"
 +
$ git config --global user.email "Y.Name@science.ru.nl"
 +
</syntaxhighlight>
 +
 +
Create a new repository
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
cd /tmp/
+
$ mkdir newproject
git svn clone --no-metadata -A users.txt https://svn.science.ru.nl/repos/myproject
+
$ cd newproject
cd myproject
+
$ git init
git remote add gitlab git@gitlab.science.ru.nl:scienceloginname/myproject.git
+
$ touch README.md
git push --set-upstream gitlab master
+
$ git add README.md
 +
$ git commit -m "first commit"
 +
$ git remote add origin git@gitlab.science.ru.nl:yourscienceloginname/newproject.git
 +
$ git push -u origin master
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Git URLs (https and ssh) are shown on the top of the project page in gitlab.
+
Push an existing Git repository
The generic repository URL for the [[Subversion|science SVN server]] is:
+
<syntaxhighlight lang="bash">
 +
$ cd existing_git_repo
 +
$ git remote add origin git@gitlab.science.ru.nl:yourscienceloginname/newproject.git
 +
$ git push -u origin master
 +
</syntaxhighlight>
  
<code>https://svn.science.ru.nl/repos/{repository}</code>
 
  
You can also see this for public svn repositories on https://svn.science.ru.nl (viewing private repositories requires authentication).
+
<references />

Latest revision as of 11:53, 5 February 2019

About GitLab

GitLab logo
GitLab

Quote from the GitLab website

GitLab is an incredibly powerful open source code collaboration platform, git repository manager, issue tracker and code reviewer.

Our gitlab service is facing the public internet. Meaning you don't need to make use of a VPN tunnel to use it.

Changes

  • 2019-01-25 GitLab updated to version 11.7.0 and moved to a new Ubuntu 18.04 server. You might encounter an SSH prompt when pushing or pulling code. The current ssh fingerprints are:
256 SHA256:iWfwGvGZ/hdFImBzzG5Bu/y5gqhUkLOdSTYmzl1+k2w root@gitlab7 (ED25519)
2048 SHA256:lWWFUfhwODG0bBuQJUR8ymlVfqpNHrXk0xbFAoDpTIg root@emoe (RSA)
256 SHA256:pBFiBobAQTozB0xeeMCp3Du2PFtX7YIXw6XRFJSAGH0 root@gitlab7 (ECDSA)
  • 2016-09-13 Configured reply by email. You can now simply reply by email to gitlab mail notifications.
  • 2016-07-18 Setup GitLab LFS (Large File Storage).

Maintenance window

Updates to GitLab are usually done on Friday mornings. The upgrade procedure consists of:

  • blocking ssh and http access
  • perform a backup
  • upgrade GitLab
  • test
  • restore ssh and http access

and can take up to 1 hour.

Logging in

Navigate to:

http://gitlab.science.ru.nl

You'll see two login options:

  • Science login - for students and employees of the Science Faculty. Use your Science login.
  • Standard - for external users.

Science login

Although anyone with a Science Login can login to GitLab, only people that have actually logged in to GitLab will be visible for other GitLab users. Keep that in mind when adding people to projects or groups.

Git and managing large files

As of July 18th 2016, LFS (Large File Storage) support is enabled on the GitLab server. Git LFS allows you to manage version control on large files without storing them in the git repository. Please refer to the Git LFS project website for more information. Be aware that git-lfs works with the https transport layer (not ssh). However, since version 8.12, it's a lot easier to use:

Note: With 8.12 GitLab added LFS support to SSH. The Git LFS communication still goes over HTTP, but now the SSH client passes the correct credentials to the Git LFS client, so no action is required by the user. (source GitLab Documentation: Git LFS)

External users

Since projects are usually not restricted to employees or students of the Science Faculty, our GitLab service allows external users as well. If you wish to add external users to your GitLab project, please send a request to , mentioning the following details:

  • Desired login name - We'll prefix it with an underscore by means of avoiding collisions with our existing and future Science logins.
  • Full name - This is how you'll find the user in the GitLab system. For example, when adding the account to your project.
  • Mail address. GitLab will use this mail address to send an automatically generated mail with instructions to set a password.

As soon as Postmaster created the account, you should be able to add the external login as a member your project. We're not yet sure whether external users should have the option to create projects, so the project limit for external users is set to 0 initially. Depending on the kind of work flow (gitlab merge requests, etc), it might be necessary to give external users the option to create one or more projects.

Ideally, postmaster should not be 'in the loop' and users with a Science login should be able to create external user accounts themselves, however there seems to be a bug in the GitLab API that prevents us from setting this up.

Documentation


Keyboard shortcuts

Press ? to display all available keyboard shortcuts!


Instructions displayed when creating a new project

Just copied them over here, because these instructions are only displayed when your project does not yet contain any files.

Git global setup

$ git config --global user.name "Your Name"
$ git config --global user.email ""

Create a new repository

$ mkdir newproject
$ cd newproject
$ git init
$ touch README.md
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin :yourscienceloginname/newproject.git
$ git push -u origin master

Push an existing Git repository

$ cd existing_git_repo
$ git remote add origin :yourscienceloginname/newproject.git
$ git push -u origin master