Git & Gitlab

What is Git?

Git is a version control system that tracks changes in your files and enables collaboration. It works for any type of file and allows multiple people to work together without conflicts.

Key benefits for researchers:

  • Never lose work: Every version of your files is saved and recoverable

  • Collaborate safely: Multiple people can work on the same project files simultaneously

  • Track progress: See exactly what changed, when, and by whom

  • Backup automatically: Your work exists in multiple places

  • Reproduce results: Return to any previous version of your analysis

Git Learning Resources

If you are new to Git, these free online resources are a great place to start

What is GitLab?

GitLab is a web platform that hosts your Git repositories and adds collaboration tools. The University of Surrey runs its own GitLab instance at https://gitlab.surrey.ac.uk.

Why use our local GitLab instance?

  • Your data stays at Surrey: Research data remains within university infrastructure

  • Integrated with university systems: Uses your existing Surrey login

  • Unlimited private repositories: Keep your research projects secure

  • Built for collaboration: Share projects with supervisors and research teams

  • Free and supported: No costs, with local IT support

  • Access to premium features: Our instance provides GitLab Premium features, for example, advanced project management tools or security scans

Essential features for research:

  • Repository hosting: Store code, data, and documentation together

  • Issue tracking: Manage research tasks and questions

  • Merge requests: Collaborate on code and get feedback

  • GitLab Pages: Create websites for your projects (see dedicated section)

Authentication Methods

While you can login to Gitlab’s webinterface with your Surrey login credentials, to pull and push source code changes, you or your IDE will need a different authentication method:

SSH Keys (Recommended) The most secure and convenient method. Once set up, you’ll never need to enter passwords for Git operations. See SSH Keys for an introduction and Generating SSH Keys for setup instructions.

Personal Access Tokens (Alternative) Password-like tokens with specific permissions. Useful for temporary access or automated tools. To create a token:

Gitlab → User Icon → Preferences → Access Tokens → Create with required permissions.

Proposed Next Steps

  1. Set up authentication using SSH Keys: See SSH Keys

  2. Try the sample project: Learn basic GitLab workflow, see GitLab Sample Project

  3. Explore GitLab Pages: Create project websites and documentation, see GitLab Pages