aboutsummaryrefslogtreecommitdiff
path: root/SETUP.md
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2024-05-20 09:39:05 +0200
committerJonas Smedegaard <dr@jones.dk>2024-05-20 09:39:05 +0200
commitb03347f7e43c3c312e15b3dae1ff342f5a6140ad (patch)
tree76c5c2693d1ac58a3bf8be1e7803c66c6ce6d961 /SETUP.md
parent54c24fe1aac1dcfbfc5ad0206fbeecf877465662 (diff)
modernize markdown: use triple-backtick (not tab) for code block
Diffstat (limited to 'SETUP.md')
-rw-r--r--SETUP.md48
1 files changed, 32 insertions, 16 deletions
diff --git a/SETUP.md b/SETUP.md
index be8fbcd..09df9cc 100644
--- a/SETUP.md
+++ b/SETUP.md
@@ -29,19 +29,25 @@ To turn a folder into a git repository
go into the folder,
and initialize its git and git-annex databases:
- git init
- git annex init
+```shell
+git init
+git annex init
+```
To use git-annex only for large files (git for smaller ones),
add e.g. the following to file `.gitattributes`:
- * annex.largefiles=((largerthan=100kb)and(not(mimetype=text/*)))
- *.svg annex.largefiles=nothing
+```gitconfig
+* annex.largefiles=((largerthan=100kb)and(not(mimetype=text/*)))
+*.svg annex.largefiles=nothing
+```
Finally (save)[#Save] all content:
- git annex add .
- git commit -m "Initial commit"
+```shell
+git annex add .
+git commit -m "Initial commit"
+```
(final `git commit` is implied by [`git annex sync` or `git annex move`](#clone))
@@ -52,23 +58,31 @@ To collaborate on a shared git repository,
first create a local clone from the shared location,
and tell git-annex to use it:
- git clone git://[[!template id=githost]]/example
- git annex init
+```shell
+git clone git://[[!template id=githost]]/example
+git annex init
+```
Then from time to time syncronize,
ensuring that all content exists both locally and remotely:
- git annex sync --content --all
+```shell
+git annex sync --content --all
+```
Alternatively (e.g. on slow/expensive network),
syncronize only metadata and only with nearest clones:
- git annex sync
+```shell
+git annex sync
+```
Alternatively (e.g. on small host),
push the content to only be remote without keeping a local copy:
- git annex move .
+```shell
+git annex move .
+```
### Publish
@@ -78,11 +92,13 @@ first create a new empty git and git annex publicly,
then tell your local git where its new origin will be,
and finally push your local git and git annex into its new public location:
- ssh [[!template id=githost]] git init --bare --shared /srv/git/[[!template id=githost]]/example.git
- ssh [[!template id=githost]] GIT_DIR=/srv/git/[[!template id=githost]]/example.git git annex init
- git remote add origin [[!template id=githost]]:/srv/git/[[!template id=githost]]/example.git
- git push --set-upstream origin master
- git annex sync --content --all
+```shell
+ssh [[!template id=githost]] git init --bare --shared /srv/git/[[!template id=githost]]/example.git
+ssh [[!template id=githost]] GIT_DIR=/srv/git/[[!template id=githost]]/example.git git annex init
+git remote add origin [[!template id=githost]]:/srv/git/[[!template id=githost]]/example.git
+git push --set-upstream origin master
+git annex sync --content --all
+```
## References