How-to: Source Control via Gitlab
About
Open source software to collaborate on code - Manage Git repositories with fine-grained access controls that keep your code secure. Perform code reviews and enhance collaboration with merge requests. Each project can also have an issue tracker.
Source control for code via the Gitlab community edition is provided for researchers. Researchers with an ITS account may access the service via https://gitlab.rit.albany.edu. Gitlab provides the added benefit of making repositories "private", so that research code may be private until published as public.
Documentation
Generic documentation available: https://docs.gitlab.com/ee/intro/
Action
On November 26th, 2021 GitLab was migrated to another host. Because we moved the service into a docker container we had to change the git+ssh port that GitLab uses for pushing and pulling code. This should be a one-time change for people that have existing code already cloned and are working on remote branches.
Instructions
If you are pushing and pulling via https then no changes need to be made.
Old Syntax | New Syntax |
---|---|
git@gitlab.rit.albany.edu:ritstaff/arcc-ansible.git | ssh://git@gitlab.rit.albany.edu:222/ritstaff/arcc-ansible.git |
In this case the new syntax requires 'ssh://' before the string and the port number '222/' inserted before the repo name. Below is an example of the command line you will need to enter.
$ git remote -v
origin git@gitlab.rit.albany.edu:ritstaff/docker-pfid.git (fetch)
origin git@gitlab.rit.albany.edu:ritstaff/docker-pfid.git (push)
$ git pull
Already up-to-date.
$ git remote set-url origin ssh://git@gitlab.rit.albany.edu:222/ritstaff/docker-pfid.git
$ git pull
Warning: Permanently added '[gitlab.rit.albany.edu]:222' (ECDSA) to the list of known hosts.
Already up-to-date.
If you are concerned about getting the syntax wrong you can go to the webpage and copy the origin from the project page.
If you have concerns or would like assistance please reach out to us.