Blog
Chiffrement
Autre
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
/home/jean/annex2 /home/jean/annex
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
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”):
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
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
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 .
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
Source http://git-annex.branchable.com/tips/deleting_unwanted_files/
git annex drop --force file git annex whereis file git annex drop --force file --from $repo rm file; git annex sync
git repack -ad git gc
Si le git status est long
git config core.ignoreStat true
Voir
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)
export EDITOR=vim git replace --edit git-annex:remote.log
Pour voir les métadonnées associé à un fichier
git annex metadata fichier
Passer en mode Direct
En mode Direct les fichiers sont directement modifiables
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”
git annex untrust .
A tout moment nous pouvons repasser en mode Indirect (pour utiliser les commandes Git, par exemple)
git annex indirect
Pour modifier un fichier en mode Indirect
git annex unlock fichier
En mode Direct, les commandes git peuvent être utilisées grâce à la commande préfixe git annex proxy
git annex undo file
Gestion de la confiance
semitrust (défaut), untrust, trust, dead
git annex untrusted [Dépôt]
Exemple :
git annex untrusted .
--trust pas être utilisé comme option
http://git-annex.branchable.com/backends/
.gitattributes
*.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
git annex vicfg
$ git annex fsck --from=myspecialremote gpg: can't query passphrase in batch mode gpg: decryption failed: secret key not available
Solution
eval $(gpg-agent --daemon)
Si pas d’interface graphique
export GPG_TTY=$(tty)
git-annex list git-annex whereis FICHIER git-annex info REMOTE git annex get . --from REMOTE --debug git annex fsck --from REMOTE
git annex unused
git annex test
Si un “special remote” a été décommissionné
git annex drop . --from cloud --force git remote remove cloud