Skip to content

Work locally on your computer

Working locally means editing a dataset repository on your computer instead of in the GitLab browser interface. This is required when you need to work with LFS files, such as NIfTI, image, audio, or other large files. It is also useful for larger updates or when you prefer to use local tools or VS Code extensions.

Before you can work locally, you need to clone the dataset repository to your computer. See Download data for instructions on how to clone a dataset project.

We recommend using Visual Studio Code for local editing. VS Code provides a graphical interface for common Git actions, such as changing branches, reviewing changes, committing, and pushing changes back to the ANC GitLab repository.

Open the dataset in VS Code

  1. Open Visual Studio Code.
  2. Select File > Open Folder.
  3. Select the folder of the cloned dataset repository.
  4. Open the folder.

VS Code will detect that the folder is a Git repository and show the current branch in the bottom-left corner of the window.

Change to the merge request branch

As described in the basic GitLab merge request workflow, changes should be made on the branch associated with your merge request. Do not make changes directly on the main branch.

To change branches in VS Code:

  1. Select the branch name in the bottom-left corner of VS Code.
  2. Select the branch associated with your merge request.
  3. If prompted, confirm that you want to switch to that branch.

Ensure the right branch

Always make sure you are working on the branch associated with your merge request. The current branch is shown in the bottom-left corner of VS Code.

If you cloned the repository before creating the merge request, the merge request branch may not appear immediately. In that case, use Fetch or Pull in VS Code to update the list of available remote branches.

Pull changes before editing

Before making changes, make sure your local copy is up to date with the ANC GitLab repository.

In VS Code:

  1. Select Source Control () on the left side of the window.
  2. Select More Actions (...).
  3. Select Pull.

Pulling downloads the latest changes from the ANC GitLab repository to your local copy. Pulling before you start working reduces the risk of conflicts with changes made by others.

Make changes locally

After you have selected the correct branch and pulled the latest changes, you can edit files locally.

You can use VS Code or other local tools to:

  • Edit or rename files.
  • Add new files.
  • Delete files.
  • Work with LFS files.

Be careful when editing large files. LFS files are stored differently from regular text files and should only be changed intentionally.

Commit and push changes

A commit is a saved set of changes with a short message describing what was changed. Commits help document the update and make it easier for Data Stewards to review the merge request.

The process of reviewing, staging, and committing changes in VS Code is similar to the Web IDE workflow described in Work remotely in the browser.

The important difference is that local commits are saved only on your computer until you push or sync them to ANC GitLab. After committing your changes, in Source Control () of VS Code, select Sync Changes or Push to make them visible in the merge request.

You can continue working locally and push additional commits, or return to ANC GitLab to review the merge request and request a review from your Data Steward.