diff options
-rw-r--r-- | SETUP.md | 48 | ||||
-rw-r--r-- | USE.md | 32 |
2 files changed, 55 insertions, 25 deletions
@@ -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 @@ -14,11 +14,15 @@ while some is done using git-annex-specific commands. To check status of metadata, use git: - git status +```shell +git status +``` To check status of file content storage, use git-annex: - git annex info +```shell +git annex info +``` ## Save @@ -28,9 +32,11 @@ for git-annex archival, first mark which files are involved and then archive their (changes to) content: - git annex add foo bar - git annex add baz - git commit -m "Update foo bar, and add baz." +```shell +git annex add foo bar +git annex add baz +git commit -m "Update foo bar, and add baz." +``` (final `git commit` is implied by [`git annex sync` or `git annex move`](#clone)) @@ -42,12 +48,16 @@ you obviously want to sometime work with the content locally. To fetch content of current folder and all subfolders: - git annex get . +```shell +git annex get . +``` To afterwards relieve local storage of git-annex tracked content in current folder and all subfolders: - git annex move . +```shell +git annex move . +``` To fetch or relieve a single file or another directory, replace the dot with the path to the file or directory. @@ -61,13 +71,17 @@ Many audio formats can be split with the package shntool and appropriate helper tools, e.g. like this for a FLAC file with CUE file for splicing hints: - shnsplit -o flac -f CUE_FILE.cue FLAC_FILE.flac +```shell +shnsplit -o flac -f CUE_FILE.cue FLAC_FILE.flac +``` For many other formats, including video content, splitting can be done using the [copy] parameter to FFMpeg, e.g. like this: - ffmpeg -i INFILE -ss 15 -t 60 -acodec copy -vcodec copy OUTFILE +```shell +ffmpeg -i INFILE -ss 15 -t 60 -acodec copy -vcodec copy OUTFILE +``` [copy]: https://ffmpeg.org/ffmpeg.html#Stream-copy "FFMpeg copy parameter" |