Our code repositories are hosted on the cloud version of GitLab, GitLab.com. You can access them from the link provided to you by the internship program by week 2. If you have any problems viewing the projects or repositories, you may need to ask for access.
Clone
To clone a repository to begin contributing to it, run git clone https://gitlab.com/sdsc-rds/[REPOSITORY PATH].git
. This should create a copy of the repo saved locally on your machine. To find the url for a repository that you would like to clone, first navigate to the repository on GitLab. Then, you can click “Clone” in the upper right and choose between SSH or HTTPS.
To use SSH, you will need to have added an SSH key to your GitLab account. To use HTTPS, you will just need to know your username and password.
Branch
You want to keep development to a separate branch on your local machine to avoid conflicts. Branching isn’t necessary if you are the only person working on a project, but it’s still good practice to do it. The general structure during development will look like this
Run:
git checkout dev
git branch [BRANCH NAME]
git checkout [BRANCH NAME]
You have now created a new branch that is a copy of dev and can begin development. Typically you would name the branch something related to what you are implementing.
Make Changes
Make whatever changes might be needed to do what you need. Commit often so you don’t lose your progress.
Push Changes
To push changes, the general workflow is:
checkout dev -
git checkout dev
pull to update dev -
git pull
checkout your feature branch -
git checkout [BRANCH NAME]
merge dev into your feature branch -
git merge dev
resolve any merge conflicts
test to make sure everything works
push your feature branch to the repository -
git push -u origin [BRANCH NAME]
submit a merge request from your feature branch to dev
Submit a Merge Request
At this point in the guide, you have implemented a new feature and correctly pushed it to the dev branch. It’s not on the master branch yet. After the new feature is deemed to be prod-ready, you want to get those changes onto the master branch to go out into production.
Go to the GitLab repository page
On the left side, click the “Merge Requests” tab
Click “New Merge Request”
Select the source branch to be dev
Select the target branch to be master
Click Compare branches and continue
Fill out the necessary fields
Click submit merge request