User Tools

Site Tools



Since July 2016 we use GitLab to collaborate.

UNIBZ users have to login to GitLab and their account will be automatically enabled.

External users can sign up with their Google, Twitter, or Facebook account.

Here are some instructions on GitLab to ease its use.

If you need support on old repositories created via SVN please continue reading here.

Initial setup

Git is usually preinstalled in Linux and Mac, while in Windows you have to install a client.

You can have different hosts for different Git repositories which you access via specific username/e-mail. You have to configure your local Git with these settings.

The steps for pushing and pulling via SSH Key

Identify or create the SSH key

If you need support on how to generate the SSH key follow our guide on How to add an SSH Key for GITLAB.

Add an SSH key

If you already have an SSH key login to GitLab and go to → Profile Settings → SSH Keys. In the field Key copy the contents of the file: (or any other file containing your key). Once you click Add Key, you will see the it listed.

Configure your local Git Client

Before proceeding check if your GIT client is already configured. LINUX/MACOSX terminal or Windows GIT bash , type the following:

git config --global --list
 git config --list 

If you use only one server for Git repositories configure it globally, otherwise locally.

Global GIT configuration

To configure GIT globally using the SSH key Inside the terminal/command line, type:

git config --global "Firstname Lastname"
git config --global ""
git config --list

This data is stored in your gitconfiguration file: Linux/Mac: ~/.gitconfig Windows: C:\Users\username\.gitconfig

The content should be:

        name = Lastname Firstname
        email =

Add your server data and insert this data in your ssh configuration file.

Linux/Mac file ~/.ssh/config:

     user your_username

Windows file ~/.ssh/config:

RSAAuthentication yes
IdentityFile ~/.ssh/config/

Local Configuration

You have to run the commands inside the directory where you want your repository to be. From terminal/command line, type:

cd repository_folder
git config "Firstname Lastname"
git config "your_other@email"

Should you receive this message fatal: not in a git directory, you have to initialize the folder as a git folder. Issue command :

git init

and run commands again.

Basic Git

The logic of git requires you to checkout a project via CLONE. You ensure the project files are up to date by issuing a PULL command. Once the modifications on the project are done, you ADD the changes, you COMMIT them and you PUSH them to the gitlab server.

Create a new project via the web interface

Create a new project via the web interface.

Send the checkout URL to other collaborators. You can copy/paste it from the project settings (as SSH or as HTTPS).

When you checkout and you are asked for a password/username it means your configuration has to be edited. Do not insert your username/password.

Clone in new folder

git clone
cd my-first-project
git add
git commit -m "add README"
git push -u origin master

Clone in existing folder

cd existing_folder
git init
git remote add origin
git add .
git commit
git push -u origin master

Go to the master branch to pull the latest changes from there

git checkout master

Download the latest changes in the project

This is for you to work on an up-to-date copy (it is important to do every time you work on a project), while you setup tracking branches.


(REMOTE: origin) (NAME-OF-BRANCH: could be “master” or an existing branch)

Create a branch

Spaces won't be recognized, so you need to use a hyphen or underscore.

git checkout -b NAME-OF-BRANCH

Work on a branch that has already been created

git checkout NAME-OF-BRANCH

View the changes you've made

It's important to be aware of what's happening and what's the status of your changes.

git status

Add changes to commit

You'll see your changes in red when you type “git status”.


Send changes to


An example:

git add .
git commit
git push -u origin master

Delete all changes in the Git repository, but leave unstaged things

git checkout .

Delete all changes in the Git repository, including untracked files

git clean -f

Merge created branch with master branch

You need to be in the created branch.

git checkout NAME-OF-BRANCH
git merge master

Some support cases

SourceTree failing to connect

  • Delete entry in keychain for
  • Add key again to ssh client : ssh-add -K <key_path>

Renew the SSL certificates -

Certificate is valid for 3 months

A cronjob renews the certificate every 1st day of the month

root@gitlab:~# vi /etc/cron.monthly/renew-le-certs
# At 04:05 on day-of-month 1.
5 4 1 * *       /opt/gitlab/bin/gitlab-ctl renew-le-certs
# At 04:10 on day-of-month 1.
10 4 1 * *      /opt/gitlab/bin/gitlab-ctl reconfigure
/data/www/ · Last modified: 2021/07/05 18:09 by kohofer