git-drs

Commands Reference

Current reference for the cleaned git-drs CLI.

Navigation: Getting Started -> Commands Reference -> Troubleshooting

Core Setup

git drs install

Install global Git filter configuration for git-drs.

git drs install

This sets the global filter.drs.* entries used by Git clean/smudge/filter operations.

git drs init

Initialize or repair repo-local git-drs wiring in the current repository.

git drs init [flags]

Common flags:

Use this when you want explicit initialization or to repair repo-local hooks/config. For normal onboarding, git drs remote add ... now bootstraps repo-local setup automatically when it is missing.

Remote Configuration

git drs remote add [name] <endpoint-or-alias> [flags]

Add a DRS server with the unified remote command. The built-in aliases are calypr, terra, synapse, and cgc; inspect their non-secret defaults with git drs preset list or git drs preset show <alias>.

git drs remote add cgc --credential env:CGC_TOKEN
git drs remote add synapse --credential helper:synapse
git drs remote add terra --scope my-billing-project/my-workspace
git drs remote add https://drs.example.org --provider ga4gh --auth none
git drs remote add research https://gen3.example.org \
  --provider gen3 --scope PROGRAM/PROJECT \
  --auth provider-helper:gen3-profile --credential profile:research

For a preset, its alias becomes the default local name; for a URL, the name is derived from the host. Use the two-argument form to choose a name explicitly. --credential accepts env:VARIABLE, file:PATH, helper:NAME, profile:NAME, or stdin; it never accepts an inline secret. Other options are --scope, --auth, --provider, --storage, and --checkout. Checkout mode is pointers or hydrate.

Provider values are auto, ga4gh, gen3, terra, cgc, and synapse. Authentication values are auto, none, bearer, basic, google-adc, provider-helper, or provider-helper:<name>. Presets are expanded once and the resolved endpoint, provider, authentication method, and catalog version are saved, so a later release cannot silently redirect an existing remote. Only HTTPS endpoints without embedded credentials are accepted.

The older gen3, local, and terra command shapes are deprecated, hidden compatibility forms. New scripts should use the unified command.

git drs preset list / git drs preset show <alias>

Display the presets embedded in this release. list shows each alias, provider, endpoint, and catalog version. show also displays its authentication default and, when present, registry service ID. Presets contain no credential or secret values.

Alias Provider Authentication default
calypr Gen3 Gen3 profile provider helper
terra Terra Google Application Default Credentials
synapse Synapse bearer token
cgc Cancer Genomics Cloud bearer token

The legacy provider-specific remote add gen3, remote add local, and remote add terra forms remain only as hidden, deprecated compatibility commands. Do not use them in new instructions or scripts.

git drs remote list

List configured git-drs remotes.

git drs remote list

git drs ping [remote-name]

Show the effective git-drs remote configuration and verify that the remote responds.

git drs ping
git drs ping anvil

What it checks:

Example Terra preset configuration and ping:

git drs remote add anvil terra --scope my-billing-project/my-workspace
git drs ping anvil

Terra credential configuration:

A successful Terra ping includes:

remote: anvil (default)
type: terra
endpoint: https://data.terra.bio
health: ok

Troubleshooting:

For developers, the live Terra ping integration test is intentionally behind the integration build tag because it reaches the public Terra DRS service:

go test -tags=integration ./cmd/ping -run TestIntegrationPingTerraDRSServer -count=1

Set GIT_DRS_TERRA_DRS_ENDPOINT to point the test at a different Terra DRS deployment. Terra’s DRSHub resolver URL follows the https://drshub.dsde-<env>.broadinstitute.org/api/v4/drs/resolve pattern used by terra-notebook-utils, but git drs ping needs the GA4GH DRS service base URL that exposes /ga4gh/drs/v1/service-info; for Terra production that service base URL is https://data.terra.bio.

git drs remote remove <remote-name>

Remove a configured git-drs remote.

git drs remote remove <remote-name>
git drs remote rm <remote-name>

This removes git-drs remote config, not normal Git remotes.

git drs remote set <remote-name>

Set the default git-drs remote.

git drs remote set production

Remote roles: primary and source authorities

A repository can have multiple git-drs remotes. The configured default remote, drs.default-remote, or an explicit command-level remote is the primary remote for repository-scoped operations such as push, registration, checksum lookup, and provider inspection.

A source DRS authority/resolver is the DRS service named by a drs://... URI or by source metadata recorded for a reference-first object. For git drs add-ref, the client resolves the input drs://... URI against that source authority/resolver using source credentials. The primary remote does not act as a proxy for other source DRS servers.

When the source authority is also configured as one of the repository remotes, git-drs can use that remote’s endpoint and credentials for the source request. When the source authority is not configured as a named remote, the source URI itself remains the retrieval identity; adding the reference still does not create or mutate a primary-remote DRS record.

Tracking and Local Inventory

git drs track <pattern>

Track files or globs with git-drs pointer behavior.

git drs track "*.bam"
git drs track "data/**"

Stage .gitattributes after changing tracked patterns.

git drs untrack <pattern>

Stop tracking a pattern.

git drs untrack "*.bam"

git drs ls-files [pathspec...]

List tracked files in the current checkout.

git drs ls-files
git drs ls-files -l
git drs ls-files --drs
git drs ls-files -I "*.bam"
git drs ls-files -n results/**

Important behavior:

Common flags:

Hydration and Push

git drs pull

Hydrate tracked pointer files already present in the current checkout.

git drs pull
git drs pull -I "*.bam"
git drs pull -I "data/**" -I "results/*.txt"
git drs pull --dry-run -I "results/**"

Important behavior:

git drs push [remote-name]

Run the managed git-drs push path.

git drs push
git drs push production

What it does:

Notes:

Provider/Object Reference Workflows

For details on pointer file formats and lifecycle state, see Pointer Files and Reference State.

git drs add-url <object-url-or-key> [path]

Create a pointer plus local DRS metadata for an object that already exists in provider storage.

git drs add-url path/to/object.bin data/from-bucket.bin --scheme s3
git drs add-url s3://my-bucket/path/to/object.bin data/from-bucket.bin
git drs add-url s3://my-bucket/path/to/object.bin data/from-bucket.bin --sha256 <hex>

Notes:

git drs add-ref <drs-id> <path>

Add a local pointer file for an existing DRS object. If the source DRS object has a SHA256 checksum, the pointer can use that checksum; otherwise the pointer preserves the source drs://... URI directly so hydration can resolve by DRS identity instead of checksum lookup.

git drs add-ref drs://example/object-id data/object.bin

add-ref also adds an exact read-only filter=drs rule for the destination to .gitattributes. Stage that file together with the pointer so local inventory commands such as git drs ls-files can discover the reference.

git drs query <drs-id>

Query a DRS object by ID or checksum.

git drs query drs://example/object-id
git drs query --checksum <sha256>

Delete and Copy Workflows

git drs rm <path>...

Remove tracked git-drs files from the worktree and index.

git drs rm data/sample.bam
git drs rm data/sample1.bam data/sample2.bam

What it does:

Remote behavior on push:

git drs copy-records [source-remote] <target-remote> <organization/project>

Copy Syfon metadata records from one configured remote to another for one scope.

git drs copy-records prod HTAN_INT/BForePC
git drs copy-records dev prod HTAN_INT/BForePC

Behavior:

Merge behavior for existing target records:

Bucket Mapping Commands

These are typically steward/admin setup commands, not normal day-to-day end-user commands.

git drs bucket add

Declare bucket credentials for a remote.

git drs bucket add-organization

Map an organization to a bucket path.

git drs bucket add-organization production \
  --organization HTAN_INT \
  --path s3://cbds/htan-int

git drs bucket add-project

Map a project to a bucket path.

git drs bucket add-project production \
  --organization HTAN_INT \
  --project BForePC \
  --path s3://cbds/htan-int/bforepc

Version

git drs version

Display version information.

git drs version

Removed Legacy Commands

These commands are gone from the cleaned CLI:

If older notes mention them, treat those references as stale.