Getting Started¶
This guide walks you through setting up Git DRS and performing common workflows.
Navigation: Installation → Getting Started → Commands Reference → Troubleshooting
Repository Initialization¶
Every Git repository using Git DRS requires configuration, whether you're creating a new repo or cloning an existing one.
Cloning Existing Repository (Gen3)¶
- Clone the Repository
- Configure SSH (if using SSH URLs)
If using SSH URLs like git@github.com:user/repo.git, add to ~/.ssh/config:
-
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
- Verify Configuration
Output:
The * indicates this is the default remote.
New Repository Setup (Gen3)¶
- Create and Clone Repository
-
Configure SSH (if needed - same as above)
-
Get Credentials (same as above)
-
Get Project Details
Contact your data coordinator for: - DRS server URL - Project ID - Bucket name
- Initialize Git DRS
- 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-bucket
Note: Since this is your first remote, it automatically becomes the default. No need to run git drs remote set.
- Verify Configuration
Output:
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 staging
File Tracking¶
Git DRS uses Git LFS to track files. You must explicitly track file patterns before adding them.
View Current Tracking¶
Track Files¶
Single File
File Pattern
Directory
Untrack Files¶
# View tracked patterns
git lfs track
# Remove pattern
git lfs untrack "*.bam"
# Stage changes
git add .gitattributes
Basic Workflows¶
Adding and Pushing Files¶
# 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 push
Note: Git DRS automatically creates DRS records during commit and uploads files to the default remote during push.
Downloading Files¶
Single File
Pattern
All Files
Directory
Checking File Status¶
# 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-files
Working with S3 Files¶
You can add references to existing S3 files without copying them:
# Track the file pattern first
git lfs track "myfile.txt"
git add .gitattributes
# Add S3 reference
git drs add-url s3://bucket/path/to/file \
--sha256 <file-hash> \
--aws-access-key <key> \
--aws-secret-key <secret>
# Commit and push
git commit -m "Add S3 file reference"
git push
See S3 Integration Guide for detailed examples.
Configuration Management¶
View Configuration¶
Update Configuration¶
# 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
View Logs¶
- Logs location:
.drs/directory
Command Summary¶
| 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" |
Session Workflow¶
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)
-
Download files as needed
Next Steps¶
- Commands Reference - Complete command documentation
- Troubleshooting - Common issues and solutions
- Developer Guide - Advanced usage and internals