Outils pour utilisateurs

Outils du site


tech:notes_git_annex

Ceci est une ancienne révision du document !


Notes Git Annex

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”):

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

 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/

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

git repack -ad
git gc

Si le git status est long

git config core.ignoreStat true

Métadonnées remote.log uuid.log

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

Mode direct

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

Configuration

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

Pb

$ 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) 

Information pour debug

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
tech/notes_git_annex.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki