Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

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:

  1. git checkout dev

  2. git branch [BRANCH NAME]

  3. 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:

  1. checkout dev - git checkout dev

  2. pull to update dev - git pull

  3. checkout your feature branch - git checkout [BRANCH NAME]

  4. merge dev into your feature branch - git merge dev

  5. resolve any merge conflicts

  6. test to make sure everything works

  7. push your feature branch to the repository - git push -u origin [BRANCH NAME]

  8. 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.

  1. Go to the GitLab repository page

  2. On the left side, click the “Merge Requests” tab

  3. Click “New Merge Request”

  4. Select the source branch to be dev

  5. Select the target branch to be master

  6. Click Compare branches and continue

  7. Fill out the necessary fields

  8. Click submit merge request

  • No labels