GitLab Sample Project#
This guide shows you how to create a first GitLab project and get it onto your local machine. For detailed Git tutorials, we recommend external resources listed at the bottom of this page.
Creating a Project#
Login to GitLab
Navigate to gitlab.surrey.ac.uk and login with your university credentials.
Create a New Project
Click “New project” → “Create blank project”
Fill in the project details:
Project name: “My Research Project”
Project description: Brief description of your research
Visibility level: Choose “Private” for research projects
Initialize repository with a README: ✓ Check this box
Click “Create project”
Add Collaborators (Optional)
Go to Your Project → Manage → Members
Click “Invite members”
Enter your colleague’s university email or username
Click “Invite”
If your prospective collaborator is not a member of the university, please submit a Support Ticket to request a guest account for them.
Cloning Locally#
To get your project onto your local machine where you can work with it, first set up your SSH keys and then do the following:
Get the Clone URL
On your project’s main page, click “Clone” and copy the SSH URL:
git@gitlab.surrey.ac.uk:your-username/my-research-project.gitClone the Repository
Open a terminal and run:
git clone git@gitlab.surrey.ac.uk:your-username/my-research-project.git cd my-research-project
Verify the Clone
ls -la git status
You should see your README file and confirmation that you’re on the main branch.
That’s it! You now have a local copy of your GitLab project that you can work with.
Pushing Changes#
After you made your changes let’s commit and push these changes to GitLab.
Stage Your Changes
Add the new or updated files to a new commit:
# add all new / changed files at once. This may add files you do not wish to add git add . # alternatively, only add specific files, e.g. git add file1.txt file2.py file3.c test/script.py
Commit Your Changes
Create a commit with a descriptive message:
git commit -m "Initial project structure and documentation - Added basic Python data processing script - Created project directory structure - Added comprehensive .gitignore - Updated README with project overview"
Push to GitLab
# pushes the commit to the main branch off the remote origin repo git push origin main
Verify on GitLab
Go back to your project page on GitLab to see your changes reflected in the web interface.
Tip
If you are not too familiar with git workflows, we recommend that you check out the Git Learning Resources, we have compiled here.
Please make use of the Available Support if you have questions or get stuck somewhere.
Possible Next Steps#
Learn basic Git: Use the resources linked above to understand fundamental Git workflows
Practice with your project: Add files, make commits, and push changes
Explore GitLab features: Try issues, merge requests, and collaboration tools
Create a project website: Learn about GitLab Pages