tech:notes_git_annex
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_git_annex [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:notes_git_annex [2026/07/16 11:48] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Git Annex | ||
| + | |||
| + | Blog | ||
| + | * http:// | ||
| + | |||
| + | Chiffrement | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | |||
| + | Autre | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | |||
| + | Synchro automatique avec `git annex assistant` | ||
| + | Le fichier `~/ | ||
| + | |||
| + | `~/ | ||
| + | ~~~ini | ||
| + | / | ||
| + | / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | git annex dead usbdrive | ||
| + | git annex semitrust usbdrive | ||
| + | |||
| + | git annex add $file | ||
| + | |||
| + | git annex merge | ||
| + | |||
| + | git annex sync | ||
| + | |||
| + | git annex sync --content | ||
| + | |||
| + | git annex copy $file --to otherrepo | ||
| + | |||
| + | git annex numcopies 2 | ||
| + | |||
| + | git annex drop . --from cloud | ||
| + | git annex forget --drop-dead | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Centralisé | ||
| + | |||
| + | https:// | ||
| + | |||
| + | On the server I did: | ||
| + | |||
| + | git init --bare | ||
| + | git annex init origin | ||
| + | |||
| + | On Cĺient Alice (I want to give Bob a chance get call "git annex get" from " | ||
| + | |||
| + | ~~~bash | ||
| + | git clone ssh:// | ||
| + | git annex init Alice | ||
| + | git annex merge | ||
| + | git annex add . | ||
| + | git commit -a -m "Added tutorial" | ||
| + | git push origin master git-annex | ||
| + | git annex copy . --to origin | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | git annex initremote myrsync type=rsync rsyncurl=ssh.example.com:/ | ||
| + | git annex describe myrsync "rsync server" | ||
| + | git annex enableremote myrsync | ||
| + | |||
| + | git annex enableremote myrsync keyid+=788A3F4C | ||
| + | |||
| + | git annex testremote myrsync | ||
| + | |||
| + | Désactiver temporairement | ||
| + | git config remote.myrsync.annex-ignore false | ||
| + | |||
| + | git annex unused --from myrsync | ||
| + | git annex dropunused --from myrsync 1 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## | ||
| + | |||
| + | Sur toutes les machines | ||
| + | mkdir ~/annex | ||
| + | cd ~/annex | ||
| + | git init | ||
| + | git annex init " | ||
| + | git annex add . | ||
| + | |||
| + | cd ~/annex | ||
| + | git remote add machine1 user@machine1: | ||
| + | |||
| + | |||
| + | git annex get . | ||
| + | |||
| + | |||
| + | ## Exemple | ||
| + | |||
| + | git annex add fic | ||
| + | git annex get fic | ||
| + | git rm fic | ||
| + | git annex drop fic | ||
| + | git mv fic1 fic1.old | ||
| + | |||
| + | |||
| + | git annex sync | ||
| + | |||
| + | git annex unlock my_cool_big_file | ||
| + | |||
| + | |||
| + | git annex unused | ||
| + | git annex fsck | ||
| + | |||
| + | |||
| + | ## Delete all the copies method | ||
| + | |||
| + | Source http:// | ||
| + | |||
| + | ~~~bash | ||
| + | git annex drop --force file | ||
| + | git annex whereis file | ||
| + | git annex drop --force file --from $repo | ||
| + | rm file; git annex sync | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Si Pb de performance | ||
| + | |||
| + | ~~~bash | ||
| + | git repack -ad | ||
| + | git gc | ||
| + | ~~~ | ||
| + | |||
| + | Si le `git status` est long | ||
| + | |||
| + | ~~~bash | ||
| + | git config core.ignoreStat true | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Métadonnées remote.log uuid.log | ||
| + | |||
| + | Voir | ||
| + | ~~~bash | ||
| + | git show git-annex: | ||
| + | git cat-file -p git-annex: | ||
| + | ~~~ | ||
| + | |||
| + | Editer / Modifier l' | ||
| + | ~~~bash | ||
| + | export EDITOR=vim | ||
| + | git replace --edit git-annex: | ||
| + | ~~~ | ||
| + | |||
| + | Pour voir les métadonnées associé à un fichier | ||
| + | ~~~bash | ||
| + | git annex metadata fichier | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Mode direct | ||
| + | |||
| + | Passer en mode Direct | ||
| + | |||
| + | En mode Direct les fichiers sont directement modifiables | ||
| + | |||
| + | ~~~bash | ||
| + | git annex direct | ||
| + | ~~~ | ||
| + | |||
| + | Puis, si l' | ||
| + | Comme la modification en écriture est activée et que un `git annex sync` fera un " | ||
| + | ~~~bash | ||
| + | git annex untrust . | ||
| + | ~~~ | ||
| + | |||
| + | A tout moment nous pouvons repasser en mode Indirect (pour utiliser les commandes Git, par exemple) | ||
| + | ~~~bash | ||
| + | git annex indirect | ||
| + | ~~~ | ||
| + | |||
| + | Pour modifier un fichier en mode Indirect | ||
| + | ~~~bash | ||
| + | git annex unlock fichier | ||
| + | ~~~ | ||
| + | |||
| + | En mode Direct, les commandes git peuvent être utilisées grâce à la commande préfixe `git annex proxy` | ||
| + | |||
| + | ~~~bash | ||
| + | git annex undo file | ||
| + | ~~~ | ||
| + | |||
| + | Gestion de la confiance | ||
| + | |||
| + | semitrust (défaut), untrust, trust, dead | ||
| + | |||
| + | git annex untrusted [Dépôt] | ||
| + | |||
| + | Exemple : | ||
| + | ~~~bash | ||
| + | git annex untrusted . | ||
| + | ~~~ | ||
| + | |||
| + | `--trust` pas être utilisé comme option | ||
| + | |||
| + | |||
| + | ## Configuration | ||
| + | |||
| + | http:// | ||
| + | |||
| + | `.gitattributes` | ||
| + | ~~~ini | ||
| + | |||
| + | *.mp4 annex.backend=MD5E | ||
| + | *.webm annex.backend=MD5E | ||
| + | *.flv annex.backend=MD5E | ||
| + | *.3gp annex.backend=MD5E | ||
| + | *.mov annex.backend=MD5E | ||
| + | *.mkv annex.backend=MD5E | ||
| + | *.divx annex.backend=MD5E | ||
| + | *.avi annex.backend=MD5E | ||
| + | |||
| + | *.zip annex.backend=MD5E | ||
| + | *.iso annex.backend=MD5E | ||
| + | |||
| + | *.webm annex.numcopies=1 | ||
| + | ~~~ | ||
| + | |||
| + | Note : à faire avant le `git annex init` ou voir `git annex migrate` si changement du backend (Fonction de hachage, içi MD5E) | ||
| + | |||
| + | Modifier la conf | ||
| + | ~~~bash | ||
| + | git annex vicfg | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ~~~ | ||
| + | $ git annex fsck --from=myspecialremote | ||
| + | gpg: can't query passphrase in batch mode | ||
| + | gpg: decryption failed: secret key not available | ||
| + | ~~~ | ||
| + | |||
| + | Solution | ||
| + | ~~~bash | ||
| + | eval $(gpg-agent --daemon) | ||
| + | ~~~ | ||
| + | |||
| + | Si pas d’interface graphique | ||
| + | |||
| + | ~~~bash | ||
| + | export GPG_TTY=$(tty) | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Information pour debug | ||
| + | |||
| + | ~~~bash | ||
| + | git-annex list | ||
| + | git-annex whereis FICHIER | ||
| + | git-annex info REMOTE | ||
| + | git annex get . --from REMOTE --debug | ||
| + | git annex fsck --from REMOTE | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | git annex unused | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | git annex test | ||
| + | ~~~ | ||
| + | |||
| + | Si un " | ||
| + | |||
| + | ~~~bash | ||
| + | git annex drop . --from cloud --force | ||
| + | git remote remove cloud | ||
| + | ~~~ | ||
| + | |||
