TAM GitLabTM
To use TAM GitLabTM, log in with your UMR account and complete the 2FA authentication. Please always select the Uni-Marburg Login (2FA) option.
To get the full benefit of the GitLabTM service, it is highly recommended to additionally use Git as a local version control tool.
Git vs. GitLabTM vs. TAM GitLabTM
Git is the tool installed on your local computer. It tracks changes to your files, saves different versions of your code, and allows you to manage your project history.
GitLabTM is an online platform that works with Git. It allows you to store Git repositories online, back up your work, and collaborate with others.
TAM GitLabTM is the GitLab service provided by the University of Marburg. It uses the GitLab platform and allows you to store and manage your repositories within the university infrastructure.
Without Git, uploading files manually to TAM GitLab can become inefficient, especially for large projects, as files often need to be uploaded individually. With Git installed, via one command, you can quickly push changes from your local computer to TAM GitLab, reducing upload time and avoiding unnecessary data transfers.
For uploading large files files, it is highly recommended to use a local Git installation with Git-LFS enabled, because uploading LFS-files is currently not integrated to the GitLab web application.
Without Git, you would need to repeatly download the entire project from TAM GitLabTM whenever you need the newest version, for example after a collaborator has made changes. With Git installed, via one command, you can pull the latest updates from the remote repository on TAM GitLabTM to your local computer and continue working.
Together, Git and GitLabTM make it easy to synchronize code and data between your local computer and the remote repository.
Git
Installation and Setup
Please download Git on your personal computer. If you use MaRC3 as your working environment instead of your personal computer, Git is already installed and no additional download is needed.
After installation, you need to configure Git properly. Open your command line or terminal and enter the following commands one at a time. Note: If you plan to use Git both on your local computer and on MaRC3, you need to complete this configuration on both machines.
Where is my command line?
If you are not sure where to find the command line or terminal on your computer, simply search for "Command Prompt", "Terminal", or "Command Line" using your computer’s search function.
git --version
git config --global user.name "Example Name"
git config --global user.email "example@example.com"
git config --global init.defaultBranch main
git config --global core.editor "ExampleEditor"
→ this sets the default text editor used by Git. Enter the editor you prefer. We recommend using nano or vim because they are already installed on most systems and work directly in the command line. This allows you to write commit messages (short descriptions of the changes you made in your work) in the same terminal window without opening additional applications. However, you can use any text editor you like. For example, to set nano as your global Git editor, run:
git config --global core.editor nano
git config --global core.autocrlf input
git config --global pull.rebase false
git config --global pull.merge true
cat ~/.gitconfig
[user]
name = Your Name
email = example@example.com
[init]
defaultBranch = main
[core]
editor = nano
[pull]
rebase = false
merge = true
The nano and vim text editors
In case you configured nano or vim as your default text editor when using git (vim is the default editor on MaRC3/JupyterHub): Those text editors are command-line editors which means they open directly in the terminal (no new window opens). With everything, you just need to know how to operate it:
nano:
- when the editor opens for the commit message, you need to first press enter one time to make new line at the top.
- when you've done writing your commit message, you need to save and close it: CTRL X closes it but it asks you first if you want to save it by typing a capital Y, then Enter.
vim:
- when the editor opens you first need to type i to change from command mode to insert mode
- make a new line at the top by pressing Enter
- write your commit message and then press Esc and then :wq to save and exit
Connecting Git with GitLab
To communicate with GitLabTM, you should have an ssh key assigned.
SSH Key in a nutshell
An SSH key is a secure way to authenticate your computer with GitLabTM without entering your password every time.
It consists of two parts:
- Private key: Stored securely on your computer and never shared.
- Public key: Uploaded to GitLabTM and used to verify your identity.
When you connect to GitLabTM, your computer uses the private key to prove that you are authorized to access the repository.
SSH Key Generation on your computer
You can follow these instructions to do so (login to the TAM GitLabTM required, of course). Then, go to the TAM GitLabTM and save this ssh key in your account preferences: Your Profile -> Preferences -> SSH Keys -> Add new key.
Please check connection by typing the following in your command line:
ssh git@tam-gitlab.online.uni-marburg.de
"Welcome to GitLab, your-username".
SSH Key Generation on MaRC3
Login to the JupyterHub and open a terminal.
1. Generate ssh key: ssh-keygen -t ed25519
2. Display your public key and copy it: cat ~/.ssh/id_ed25519.pub
3. Open your ssh-key config file and add Hosts manually: vi .ssh/config → In-terminal text editor opens. Press i to enable the insert mode.
Your file currently contains this:
Added by Warewulf
Host *
IdentityFile ~/.ssh/cluster
StrictHostKeyChecking=no
Please add the following manually below (respect formatting/ spaces):
Host tam-gitlab.online.uni-marburg.de
IdentityFile ~/.ssh/id_ed25519
To exit the text editor press esc and then type :wq and then press enter.
4. Go to the TAM GitLabTM and save this ssh key in your account preferences: Your Profile -> Preferences -> SSH Keys -> Add new key.
5. Check connection by typing the following in your command line:
ssh git@tam-gitlab.online.uni-marburg.de
"Welcome to GitLab, your-username".
Enable Git LFS
Git LFS stands for Large File Storage and is an open source extension to git which allows it to handle large / binary files efficiently. As we use our TAM GitLabTM not only for code development but also as the central Data Storage during active development of the project, we ask everyone to use Git LFS for their project.
Installation and Setup
1. Download git-lfs: only applied if you use your own computer. On MaRC3 / JupyterHub, Git LFS has already been installed. JupyterHub servers have it activated by default. If you connect to MaRC3 via terminal (ssh), you can enable Git LFS via its module: module load git-lfs.
2. Check installation: git lfs --version
3. Initialize git-lfs once for your username: git lfs install. This also applies to first usage on MaRC3 / JupyterHub.
If you do a cat ~/.gitconfig again, you should see the following added to your git configuration:
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f