Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move repo template into a template repo #99

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 5 additions & 39 deletions geek-tips/git-annex.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,49 +79,15 @@ See [below](#annexthin-hardlinks) to understand what this setting offers.

## New repo

Use this recipe to make new datasets:
There is a template repository on our [internal server](../data/git-datasets.md) at git+ssh://data.neuro.polymtl.ca/datasets/template.

```
mkdir my-new-repo
cd my-new-repo

git init
vi README
# write something useful in README
git add README && git commit -m "Initial commit"

cat <<EOF > .gitignore
.DS_Store
EOF

cat <<EOF > .gitattributes
# Normalize line-endings to \n
* text=auto
The key is to ensure each filetype has a line added to `.gitattributes` like

# Configure filetypes stored by git-annex.
# by default git-annex sets * filter=annex, but that is very slow:
# it copies even non-annexed files through git-annex even though it will decide not to handle them.
# this overrides that behaviour so that only annexed files must be processed.
* annex.largefiles=nothing
*.nii.gz filter=annex annex.largefiles=anything
*.nii filter=annex annex.largefiles=anything
*.tif filter=annex annex.largefiles=anything
EOF

git add .gitignore .gitattributes && git commit -m "Configure git-annex"

git annex init
# .gitattributes runs the filter on 'git add', which leaves files 'unlocked'; i.e. as themselves, instead of as symlinks into .git/annex/objects; this setting ensures files added with 'git annex add' are also 'unlocked'.
git annex config --set annex.addunlocked true

# Here, copy in or create initial files, wherever they are from:
# rsync, wget, curl, tar, dropbox, etc <...>, then run the following commands.

git add .
git commit -m "Initial data"
```
echo '*.nii.gz filter=annex annex.largefiles=anything' >> .gitattributes
```

If you are working on a private, internal dataset, continue by [uploading to `data.neuro.polymtl.ca`](../data/git-datasets.md#new-repository).
If you are working on a private, internal dataset, you can use [this script](../data/git-datasets.md#new-repository).

## `annex.thin` Hardlinks <a id="hardlinks">

Expand Down