Difference between revisions of "GitLab server"

From mi-linux
Jump to navigationJump to search
Line 71: Line 71:
 
* [Windows] SSH into mi-linux.wlv.ac.uk using an SSH client such as Putty
 
* [Windows] SSH into mi-linux.wlv.ac.uk using an SSH client such as Putty
 
* [Linux] Boot under Linux, and open a Command window.
 
* [Linux] Boot under Linux, and open a Command window.
 +
 +
=== Git commands - details ===
 +
 +
Let's look at each command in more details:
 +
 +
<pre>
 +
git config --global user.name "in9352"
 +
git config --global user.email "alix.bergeret@wlv.ac.uk"
 +
</pre>
 +
 +
The commands above simply set some global settings (your user name and email address) that are required for this process.
 +
 +
<pre>
 +
mkdir great-work-by-alix
 +
cd great-work-by-alix
 +
</pre>
 +
 +
Well, nothing too difficult here, we simply create an empty folder and move into it. Note that you may wish to move into an existing folder that already contains files instead!
 +
 +
<pre>
 +
git init
 +
</pre>
 +
 +
Here is the first interesting command. [http://git-scm.com/docs/git-init git init] creates an empty Git repository.

Revision as of 11:22, 16 February 2015

GitLab server

The University provides every student with a fully working Version Control system called GitLab:

Please note that you should only use this server to store files related to University coursework. Personal or word related files should not be stored on this server.

Signing in

You can sign in using your usual university credentials. Make sure that you select the "LDAP" tab on the "Sign in" screen:

gitlab01.png

Creating a project

Your next step is to create a "Project" that will contain your work. Click on the "+ New Project" button.

gitlab02.png

And populate the following fields:

  • Project Name
  • Description
  • Visibility Level

Important: The Visibility Level should be set to "Private" for all assessment-related work. Any other Visibility Level would allow other students to look at and clone your work, which equates to Collusion under the University's Academic Misconduct regulations.

Set the Project's Visibility level to "Private" and then manually invite new project members, via the Project's settings:

gitlab03.png

Creating your first repository

When visiting your project's homepage you are presented with some command line Git code that you should use to create your first repository. Please note that you get 2 access options:

  • SSH
  • HTTPS

We'll look that HTTPS for now, so click the "HTTPS" button near the top.

Git commands

Your project's homepage should contain commands similars to these ones:

Git global setup

git config --global user.name "in9352"
git config --global user.email "alix.bergeret@wlv.ac.uk"

Create a new repository

mkdir great-work-by-alix
cd great-work-by-alix
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin git@fsegitlab.wlv.ac.uk:in9352/great-work-by-alix.git
git push -u origin master

Push an existing Git repository

cd existing_git_repo
git remote add origin git@fsegitlab.wlv.ac.uk:in9352/great-work-by-alix.git
git push -u origin master

In order to run the code above you have 3 options:

  • [Windows] Run Git Bash, a Git client installed in all MI labs
  • [Windows] SSH into mi-linux.wlv.ac.uk using an SSH client such as Putty
  • [Linux] Boot under Linux, and open a Command window.

Git commands - details

Let's look at each command in more details:

git config --global user.name "in9352"
git config --global user.email "alix.bergeret@wlv.ac.uk"

The commands above simply set some global settings (your user name and email address) that are required for this process.

mkdir great-work-by-alix
cd great-work-by-alix

Well, nothing too difficult here, we simply create an empty folder and move into it. Note that you may wish to move into an existing folder that already contains files instead!

git init

Here is the first interesting command. git init creates an empty Git repository.