You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using openneuro-cli, git can be configured to automatically use your OpenNeuro credentials to allow access to datasets. This is the preferred method for authenticating regular git access. An advanced method of issuing a key is documented below if you cannot use the [git credential helper](https://git-scm.com/docs/gitcredentials) for your use case.
37
+
Using [@openneuro/cli](https://jsr.io/@openneuro/cli), git can be configured to automatically use your OpenNeuro credentials to allow access to datasets. This is the preferred method for authenticating regular git access. An advanced method of issuing a key is documented below if you cannot use the [git credential helper](https://git-scm.com/docs/gitcredentials) for your use case.
38
38
39
39
### Setup
40
40
41
-
Once you have openneuro-cli installed and you've logged in with `openneuro login`, you can configure git to automatically use your login.
41
+
Once you have logged in with `deno run -A jsr:@openneuro/cli`, you can configure git to automatically use your login.
42
42
43
43
```shell
44
44
# This allows the helper to identify which dataset you are accessing automatically and issue a key for that dataset
45
-
git config credential.useHttpPath true
46
-
# Point git at the openneuro-cli tool (this must be an absolute path)
# Point git at the @openneuro/cli tool (this must be an absolute path)
47
+
git config --global credential.https://openneuro.org.helper "/path/to/deno -A jsr:@openneuro/cli git-credential"
48
48
```
49
49
50
-
Alternatively openneuro-cli can be given the name `git-credential-openneuro` and this shorter command will work.
50
+
If you are using [Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager) add the provider entry to avoid duplicating entries.
51
51
52
52
```shell
53
-
git config credential.helper "openneuro"
54
-
```
55
-
56
-
This will configure these options for one repository.
57
-
58
-
To enable for all OpenNeuro repositories add this to your [git configuration file](https://git-scm.com/docs/git-config#FILES).
If you are using [Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager) add the provider entry to avoid duplicating entries.
56
+
Or by modifying your .gitconfig:
67
57
68
58
```cfg
69
59
[credential "https://openneuro.org"]
@@ -76,20 +66,20 @@ If you are using [Git Credential Manager](https://github.com/git-ecosystem/git-c
76
66
77
67
Most datalad or git operations will work as expected but there are a few limitations. Force pushes or unrelated history will be rejected. Annexed data is accepted but only via the git transport, using other annexes will result in unreachable files or failed validation due to missing data.
78
68
79
-
To download a new dataset using the credential helper you can start with an empty repo and then configure that repo.
# Follow the above steps to setup the credential helper
87
-
git pull origin master
88
-
git pull origin git-annex:git-annex
89
77
# From here you can treat this like a datalad dataset and export back to OpenNeuro to deploy changes
90
78
```
91
79
92
-
When you are ready to push changes, make sure to validate them before attempting to push. OpenNeuro will reject some invalid pushes but cannot run the full bids-validator until after your changes have been pushed.
80
+
When you are ready to push changes, make sure to validate them before attempting to push. OpenNeuro runs a limited version of BIDS validation on pushes and will reject datasets that cannot pass validation of the file tree. File contents are validated only after upload.
81
+
82
+
To push annexed files, see `Configuring OpenNeuro special remote` below.
93
83
94
84
### Advanced authentication
95
85
@@ -115,25 +105,43 @@ For private datasets or to add new data with DataLad or git-annex, a special rem
115
105
116
106
### Configuring OpenNeuro special remote
117
107
108
+
```shell
109
+
# A script is provided to wrap the CLI as a special remote
After this you can use regular git-annex or datalad commands to upload or download any annexed files by using the openneuro remote.
131
+
To download annexed objects from the remote, you may need to manually ask git-annex update the local state of the OpenNeuro remote. You can force this update for all files:
129
132
130
133
```shell
131
-
# To upload any annexed objects to the remote
132
-
git annex copy --to openneuro
134
+
git annex fsck --fast --from openneuro
133
135
```
134
136
135
-
To download annexed objects from the remote, you may need to manually ask git-annex update the local state of the OpenNeuro remote. You can force this update for all files:
137
+
After this you can use regular git-annex or datalad commands to upload or download any annexed files by using the openneuro remote.
Copy file name to clipboardExpand all lines: git.html
+36-30Lines changed: 36 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -289,28 +289,21 @@ <h2>Repository conventions<a class="headerlink" href="#repository-conventions" t
289
289
</section>
290
290
<sectionid="credential-helper">
291
291
<h2>Credential Helper<aclass="headerlink" href="#credential-helper" title="Link to this heading">¶</a></h2>
292
-
<p>Using openneuro-cli, git can be configured to automatically use your OpenNeuro credentials to allow access to datasets. This is the preferred method for authenticating regular git access. An advanced method of issuing a key is documented below if you cannot use the <aclass="reference external" href="https://git-scm.com/docs/gitcredentials">git credential helper</a> for your use case.</p>
292
+
<p>Using <aclass="reference external" href="https://jsr.io/@openneuro/cli">@openneuro/cli</a>, git can be configured to automatically use your OpenNeuro credentials to allow access to datasets. This is the preferred method for authenticating regular git access. An advanced method of issuing a key is documented below if you cannot use the <aclass="reference external" href="https://git-scm.com/docs/gitcredentials">git credential helper</a> for your use case.</p>
293
293
<sectionid="setup">
294
294
<h3>Setup<aclass="headerlink" href="#setup" title="Link to this heading">¶</a></h3>
295
-
<p>Once you have openneuro-cli installed and you’ve logged in with <codeclass="docutils literal notranslate"><spanclass="pre">openneuro</span><spanclass="pre">login</span></code>, you can configure git to automatically use your login.</p>
295
+
<p>Once you have logged in with <codeclass="docutils literal notranslate"><spanclass="pre">deno</span><spanclass="pre">run</span><spanclass="pre">-A</span><spanclass="pre">jsr:@openneuro/cli</span></code>, you can configure git to automatically use your login.</p>
296
296
<divclass="highlight-shell notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># This allows the helper to identify which dataset you are accessing automatically and issue a key for that dataset</span>
<spanclass="c1"># Point git at the @openneuro/cli tool (this must be an absolute path)</span>
299
+
git<spanclass="w"></span>config<spanclass="w"></span>--global<spanclass="w"></span>credential.https://openneuro.org.helper<spanclass="w"></span><spanclass="s2">"/path/to/deno -A jsr:@openneuro/cli git-credential"</span>
300
300
</pre></div>
301
301
</div>
302
-
<p>Alternatively openneuro-cli can be given the name <codeclass="docutils literal notranslate"><spanclass="pre">git-credential-openneuro</span></code> and this shorter command will work.</p>
<p>If you are using <aclass="reference external" href="https://github.com/git-ecosystem/git-credential-manager">Git Credential Manager</a> add the provider entry to avoid duplicating entries.</p>
<p>This will configure these options for one repository.</p>
307
-
<p>To enable for all OpenNeuro repositories add this to your <aclass="reference external" href="https://git-scm.com/docs/git-config#FILES">git configuration file</a>.</p>
<p>If you are using <aclass="reference external" href="https://github.com/git-ecosystem/git-credential-manager">Git Credential Manager</a> add the provider entry to avoid duplicating entries.</p>
@@ -321,18 +314,17 @@ <h3>Setup<a class="headerlink" href="#setup" title="Link to this heading">¶</a>
321
314
<sectionid="usage">
322
315
<h3>Usage<aclass="headerlink" href="#usage" title="Link to this heading">¶</a></h3>
323
316
<p>Most datalad or git operations will work as expected but there are a few limitations. Force pushes or unrelated history will be rejected. Annexed data is accepted but only via the git transport, using other annexes will result in unreachable files or failed validation due to missing data.</p>
324
-
<p>To download a new dataset using the credential helper you can start with an empty repo and then configure that repo.</p>
<spanclass="c1"># From here you can treat this like a datalad dataset and export back to OpenNeuro to deploy changes</span>
333
324
</pre></div>
334
325
</div>
335
-
<p>When you are ready to push changes, make sure to validate them before attempting to push. OpenNeuro will reject some invalid pushes but cannot run the full bids-validator until after your changes have been pushed.</p>
326
+
<p>When you are ready to push changes, make sure to validate them before attempting to push. OpenNeuro runs a limited version of BIDS validation on pushes and will reject datasets that cannot pass validation of the file tree. File contents are validated only after upload.</p>
327
+
<p>To push annexed files, see <codeclass="docutils literal notranslate"><spanclass="pre">Configuring</span><spanclass="pre">OpenNeuro</span><spanclass="pre">special</span><spanclass="pre">remote</span></code> below.</p>
336
328
</section>
337
329
<sectionid="advanced-authentication">
338
330
<h3>Advanced authentication<aclass="headerlink" href="#advanced-authentication" title="Link to this heading">¶</a></h3>
@@ -356,21 +348,35 @@ <h2>git-annex special remote<a class="headerlink" href="#git-annex-special-remot
356
348
<p>For private datasets or to add new data with DataLad or git-annex, a special remote is available to push data directly to OpenNeuro.</p>
<h3>Configuring OpenNeuro special remote<aclass="headerlink" href="#configuring-openneuro-special-remote" title="Link to this heading">¶</a></h3>
351
+
<divclass="highlight-shell notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># A script is provided to wrap the CLI as a special remote</span>
<p>Deno compile can be used if a single binary without network access is needed:</p>
358
+
<divclass="highlight-shell notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># This will create a `git-annex-remote-openneuro` executable you add to your path</span>
<p>Obtain the URL from the dataset page and run initremote (or enableremote if you need to update it).</p>
360
-
<divclass="highlight-shell notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># Make sure openneuro-cli is installed and available in your path</span>
361
-
<spanclass="c1"># You should see 'VERSION 1' 'EXTENSIONS' if this is working</span>
<divclass="highlight-shell notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># You should see 'VERSION 1' 'EXTENSIONS' if this is working</span>
<p>To download annexed objects from the remote, you may need to manually ask git-annex update the local state of the OpenNeuro remote. You can force this update for all files:</p>
<p>To download annexed objects from the remote, you may need to manually ask git-annex update the local state of the OpenNeuro remote. You can force this update for all files:</p>
0 commit comments