Automated Version Control


Figure 1

Changes Are Saved Sequentially

Figure 2

Different Versions Can be Saved

Figure 3

Multiple Versions Can be Merged

Setting Up Git


Creating a Repository


Tracking Changes


Figure 1

The Git Staging Area

Figure 2

The Git Commit Workflow

Exploring History


Figure 1

Git Checkout

Figure 2

A cartoon of how Git works within one local repository
https://doi.org/10.6084/m9.figshare.1328266.v1 (Non-Federal link)/ Created by Daisie Huang and provided on figshare, CC BY 4.0

Ignoring Things


Remotes in GitLab


Figure 1

Creating a Project on GitLab (Step 1)

Figure 2

Creating a Project on GitLab (Step 2)

Figure 3

Creating a Project on GitLab (Step 3)

Figure 4

Creating a Project on GitLab (Step 4)

Figure 5

The Local Repository with Git Staging Area

Figure 6

Freshly-Made GitLab Repository

Figure 7

Where to Find User Settings on GitLab

Figure 8

Screenshot of Access tokens page and Add new token button

Figure 9

Add a personal access token screen in GitLab with Token name entered and all scopes selected

Figure 10

Screenshot of GitLab's presentation of your new personal access token

Figure 11

Where to Find Repository URL on GitLab

Figure 12

GitLab Repository After First Push

Branching and Merging


Figure 1

Screenshot of the `Create merge request` button

Figure 2

Screenshot of the Merge Request

Collaborating


Figure 1

screenshot of repository page with Manage then Members selected, showing how to add Collaborators in a GitLab repository

Figure 2

screenshot of the repository page with the Code menu opened and showing the copy button under Clone with HTTPS

Conflicts


Figure 1

The Conflicting Changes

Open Science


Policy


Licensing


Citation


Commonly Included Files


Creating Metadata


Figure 1

Screenshot showing a red circle around where to click to create a new file in a GitLab repository
Screenshot of adding a new file to a GitLab repository

Figure 2

Screenshot showing a red circle around where to click to create a new file in a GitLab repository
Screenshot of adding a new file to a GitLab repository

Figure 3

Screenshot of writing a commit message for adding the code.json file to a GitLab repository
Screenshot of adding a code.json template to a GitLab repository

Figure 4

Screenshot of clicking Edit on the code.json file in the web browser
Screenshot of editing a file in GitLab

Figure 5

  • Must use the raw variant of the file, which provides access to the plain text of the file and not the GitLab-formatted text. To get the raw variant of a file, click into the file, and click the Open raw button next to the Download button: Screenshot of red circle around a button that will Open Raw version of a file

  • Figure 6

  • In GitLab, you can get the download URL by selecting Code–> right click zip (under Download source code) –> Copy Link: Screenshot of red circle showing where to click Code, zip, and Copy link buttons to get the download url

  • Software Review for Authors


    Figure 1

    Screenshot of the Issues menu item and Issues page in GitLab

    Software Review for Reviewers


    Figure 1

  • Navigate to Code -> Commits Screenshot of the menu to use to navigate to your Commits

  • Figure 2

  • Select release branch 1.0.0 Screenshot of the menu to use to navigate to your 1.0.0 branch commits

  • Figure 3

  • Copy commit SHA Screenshot of the `Copy commit SHA` button

  • Figure 4

  • Click Comment Screenshot of a comment on the review issue with the commit SHA pasted

  • Figure 5

  • Right click on the line number next to ‘metadataLastUpdated’ and select Copy Link Screenshot of right-clicking on a line of code and selecting `Copy Link`

  • Figure 6

  • Select the dropdown next to Comment and choose Start thread and then click the button Start thread Screenshot of using the dropdown menu next to `Comment` to `Start thread`

  • Figure 7

  • Reply to the comment in the review issue with the commit SHA for the commit in which the comment was addressed Screenshot of checking the `Resolve thread` checkbox and clicking `Reply` in an issue thread

  • Publishing


    Figure 1

    Screenshot of Issue Template for Publishing a Git repository

    Figure 2

    Screenshot of the note that explains a comment was automatically generated

    Figure 3

    Screenshot of creating a new Git tag

    Figure 4

    Screenshot of New Tag page

    Figure 5

    Screenshot of where to click "Create Release"

    Figure 6

    Screenshot of page used to create a Git release

    Figure 7

    Screenshot of deleting a Git branch

    Figure 8

    Screenshot of DOI activation menu

    Continuing Your Project


    Figure 1

    Diagram showing an Upstream and Origin as part of USGS Gitlab, and a Local Clone as part of the the Local Workstation. Arrows go back and forth between Upstream and Origin and between Origin and Local Clone. A dashed line goes between the Local Clone and Upstream.
    Forking Workflow Diagram

    Figure 2

    Screenshot of GitLab UI showing location of fork button

    Figure 3

    Screenshot of GitLab UI for creating a fork

    Figure 4

    Screenshot of GitLab UI for obtaining ORIGIN_URL

    Figure 5

    Screenshot of GitLab UI for creating a new merge request

    Figure 6

    Screenshot of GitLab UI for finalizing new merge request