{{tag>Brouillon}} # Notes Git Annex Blog * http://git-annex.branchable.com/devblog/ Chiffrement * https://git-annex.branchable.com/tips/fully_encrypted_git_repositories_with_gcrypt/ * http://git-annex.branchable.com/forum/security_risk_presented_by_remote.log__63__/ * http://ewen.mcneill.gen.nz/blog/entry/2014-11-15-git-annex-to-manage-media-backups/ Autre * http://git-annex.branchable.com/not/ * http://git-annex.branchable.com/tips/Bup_repositories_in_git-annex/ * https://git-annex.branchable.com/forum/syncing_non-git_trees_with_git-annex/ * https://git-annex.branchable.com/walkthrough/backups/ * http://git-annex.branchable.com/internals/ * http://endot.org/2014/01/01/git-annex-tips/ * http://git-annex.branchable.com/tips/finding_duplicate_files/ * http://obnam.org/encryption/ * http://writequit.org/articles/getting-started-with-git-annex.html * https://julien.danjou.info/blog/2011/handling-my-music-collection-with-git-annex * https://www.thomas-krenn.com/de/wiki/Git-annex * http://git-annex.branchable.com/forum/confusion_with_remotes__44___map/ Synchro automatique avec `git annex assistant` Le fichier `~/.config/git-annex/autostart` contient la liste des dépôts a synchroniser `~/.config/git-annex/autostart` ~~~ini /home/jean/annex2 /home/jean/annex ~~~ ~~~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://git-annex.branchable.com/tips/centralized_git_repository_tutorial/ 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 "origin"): ~~~bash git clone ssh://tktest@192.168.56.104/~/annex . 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:/myrsync keyid=id@joeyh.name encryption=pubkey keyid=KEYID 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 ~~~ ## Décontralisé Sur toutes les machines mkdir ~/annex cd ~/annex git init git annex init "$HOSTNAME $PWD" git annex add . cd ~/annex git remote add machine1 user@machine1:annex 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://git-annex.branchable.com/tips/deleting_unwanted_files/ ~~~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:remote.log git cat-file -p git-annex:remote.log ~~~ Editer / Modifier l'object blob de git (remote.log ou uuid.log) ~~~bash export EDITOR=vim git replace --edit git-annex:remote.log ~~~ 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'historique des versions est importante alors il convient de marquer ce dépôt à "untrust". Comme la modification en écriture est activée et que un `git annex sync` fera un "commit" ~~~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://git-annex.branchable.com/backends/ `.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 "special remote" a été décommissionné ~~~bash git annex drop . --from cloud --force git remote remove cloud ~~~