This guide walks you through setting up Git DRS and performing common workflows.
Navigation: Installation → Getting Started → Commands Reference → Troubleshooting
Every Git repository using Git DRS requires configuration, whether you're creating a new repo or cloning an existing one.
-
Clone the Repository
git clone <repo-clone-url>.git cd <name-of-repo>
-
Configure SSH (if using SSH URLs)
If using SSH URLs like
git@github.com:user/repo.git, add to~/.ssh/config:Host github.com TCPKeepAlive yes ServerAliveInterval 30 -
Get Credentials
- Log in to your data commons (e.g., https://calypr-public.ohsu.edu/)
- Profile → Create API Key → Download JSON
- Note: Credentials expire after 30 days
-
Initialize Repository
git drs init
-
Verify Configuration
git drs remote list
Output:
* production gen3 https://calypr-public.ohsu.edu/The
*indicates this is the default remote.
-
Create and Clone Repository
git clone <repo-clone-url>.git cd <name-of-repo>
-
Configure SSH (if needed - same as above)
-
Get Credentials (same as above)
-
Get Project Details
Contact your data coordinator for:
- DRS server URL
- Organization name
- Project ID
- Bucket name
- Confirmation that bucket mapping exists for your organization/project
-
Initialize Git DRS
git drs init
-
Add Remote Configuration
git drs remote add gen3 production \ --cred /path/to/credentials.json \ --url https://calypr-public.ohsu.edu \ --project my-project \ --bucket my-bucketNote: Since this is your first remote, it automatically becomes the default. No need to run
git drs remote set. -
Verify Configuration
git drs remote list
Output:
* production gen3 https://calypr-public.ohsu.eduImportant:
git drs remote addalone is not enough. Push/pull requires an existing bucket mapping for yourorganization/project(usually provisioned once by a steward/admin).
Managing Additional Remotes
You can add more remotes later for multi-environment workflows (development, staging, production):
# Add staging remote
git drs remote add gen3 staging \
--cred /path/to/staging-credentials.json \
--url https://staging.calypr.ohsu.edu \
--project staging-project \
--bucket staging-bucket
# View all remotes
git drs remote list
# Switch default remote
git drs remote set staging
# Or use specific remote for one command
git drs push production
git drs fetch stagingGit DRS can use Git LFS-compatible pointers and local object storage. You must explicitly track file patterns before adding LFS-managed files.
git lfs trackSingle File
git lfs track path/to/specific-file.txt
git add .gitattributesFile Pattern
git lfs track "*.bam"
git add .gitattributesDirectory
git lfs track "data/**"
git add .gitattributes# View tracked patterns
git lfs track
# Remove pattern
git lfs untrack "*.bam"
# Stage changes
git add .gitattributes# Track file type (if not already tracked)
git lfs track "*.bam"
git add .gitattributes
# Add your file
git add myfile.bam
# Verify LFS is tracking it
git lfs ls-files
# Commit and push
git commit -m "Add new data file"
git pushNote: Git DRS automatically creates DRS records during commit and uploads files to the default remote during push.
Single File
git lfs pull -I path/to/file.bamPattern
git lfs pull -I "*.bam"All Files
git lfs pullDirectory
git lfs pull -I "data/**"# List all LFS-tracked files
git lfs ls-files
# Check specific pattern
git lfs ls-files -I "*.bam"
# View localization status
# (-) = not localized, (*) = localized
git lfs ls-filesYou can add references to existing bucket objects without copying them:
# Track the file pattern first
git lfs track "myfile.txt"
git add .gitattributes
# Add object reference (known sha256 path)
git drs add-url s3://bucket/path/to/file \
--sha256 <file-hash>
# Or use unknown-sha (experimental sentinel mode)
git drs add-url s3://bucket/path/to/file
# Commit and push
git commit -m "Add S3 file reference"
git pushSee Cloud URL Integration Guide for detailed examples.
git drs remote list# Refresh credentials - re-add remote with new credentials
git drs remote add gen3 production \
--cred /path/to/new-credentials.json \
--url https://calypr-public.ohsu.edu \
--project my-project \
--bucket my-bucket
# Switch default remote
git drs remote set staging- Logs location:
.git/drs/directory
| Action | Commands |
|---|---|
| Initialize | git drs init |
| Add remote | git drs remote add gen3 <name> --cred... |
| View remotes | git drs remote list |
| Set default | git drs remote set <name> |
| Track files | git lfs track "pattern" |
| Check tracked | git lfs ls-files |
| Add files | git add file.ext |
| Commit | git commit -m "message" |
| Push | git push |
| Download | git lfs pull -I "pattern" |
Note: You do NOT need to run
git drs initagain. Initialization is a one-time setup per Git repository clone.
For each work session:
-
Refresh credentials (if expired - credentials expire after 30 days)
git drs remote add gen3 production \ --cred /path/to/new-credentials.json \ --url https://calypr-public.ohsu.edu \ --project my-project \ --bucket my-bucket -
Work with files (track, add, commit, push)
Use this flow when developing against a local drs-server instead of hosted Gen3.
-
Initialize repo
git drs init
-
Add local remote
git drs remote add local origin http://localhost:8080 \ --organization calypr \ --project end_to_end_test \ --bucket cbds \ --username drs-user \ --password drs-passIf your local server has no basic auth, omit
--username/--password. -
Track and push
git lfs track "*.bin" git add .gitattributes data/example.bin git commit -m "Add local DRS test file" git drs push
-
Verify pull
git drs pull # or the Git LFS compatibility path git lfs pull
For complete local/remote mode behavior and e2e runbooks, see E2E Modes + Local Setup.
-
Download files as needed
git lfs pull -I "required-files*"
- Commands Reference - Complete command documentation
- Troubleshooting - Common issues and solutions
- Developer Guide - Advanced usage and internals