This article details the steps to migrate your source code from RStudio to the UW-Madison instance of GitLab.
Managing your code is a crucial step in making your research reproducible. Git is a version control system used for tracking changes in computer files. It is generally used for source code like the code you created in RStudio. You can learn about the benefits of using git and managing your code with repositories here and here.
GitLab is a web-based Git repository that provides both public and private repositories. DoIT manages an instance of GitLab free of charge for campus researchers. However, if you are planning to leave campus, you can still get a free account with GitLab or Github. Both have generous licenses for individuals.
GitLab runs on top of Git. You can follow these steps to install Git on your computer.
As a UW-Madison faculty, staff, student or other researcher, you can request a GitLab account here.
You need to create a repository into which you will migrate your code. Follow these steps to migrate your code into the repository
New Project
button or click the disclose triangle next to the "+
" sign and then click the New Project/Directory
. Create Blank Project
option.Public
if you anticipate sharing with audiences outside UW-Madison, Internal
for inside campus sharing, or Private
if sharing will not be allowed. You can change these settings later. You will need to use the Terminal on your computer to complete these steps.
git init
git add .
git commit -m “first commit message”
git remote add origin git@git.doit.wisc.edu:<name-of-your-repository>
git branch -M main
git push -uf origin main