- What is Git Annex ?
git-annex is not a backup system. It may be a useful component of an archival system, or a way to deliver files to a backup system. For a backup system that uses git and that git-annex supports storing data in, see bup.git-annex is not a filesystem or Dropbox clone. However, the git-annex assistant is addressing some of the same needs in its own unique ways. (There is also a FUSE filesystem built on top of git-annex, called ShareBox.)git-annex is not unison, but if you’re finding unison’s checksumming too slow, or its strict mirroring of everything to both places too limiting, then git-annex could be a useful alternative.
git-annex is also not a folder mirroring system like syncthing (although syncthing could be supported as a special remote) or gut, but it can be used to sync files such a way, with certain limitations (for example, it doesn’t like syncing .git directories so much).
git-annex is also not a distributed file system like Bittorrent or ipfs but both are supported as special remotes with more work in making git-annex more distributed underway.
git-annex is more than just a workaround for git scalability limitations that might eventually be fixed by efforts like git-bigfiles. In particular, git-annex’s location tracking allows having many repositories with a partial set of files, that are copied around as desired.
git-annex is not some flaky script that was quickly thrown together. I wrote it in Haskell because I wanted it to be solid and to compile down to a binary. And it has a fairly extensive test suite. (Don’t be fooled by “make test” only showing a few dozen test cases; each test involves checking dozens to hundreds of assertions.)
git-annex is not git-media, although they both approach the same problem from a similar direction. I only learned of git-media after writing git-annex, but I probably would have still written git-annex instead of using it. git-media uses git smudge filters (recently supported in git-annex as well; see unlocked files) and may be a tighter fit for certain situations. It lacks git-annex’s support for widely distributed storage, using only a single backend data store. It also does not support partial checkouts of file contents, like git-annex does.
git-annex is similarly not git-fat, which also uses git smudge filters, and also lacks git-annex’s widely distributed storage and partial checkouts.
Similarly, git-annex is not git-lfs, which also uses git smudge filters, and appears to lack git-annex’s widely distributed storage and partial checkouts.
git-annex is also not boar, although it shares many of its goals and characteristics. Boar implements its own version control system, rather than simply embracing and extending git. And while boar supports distributed clones of a repository, it does not support keeping different files in different clones of the same repository, which git-annex does, and is an important feature for large-scale archiving.
git-annex is not the Mercurial largefiles extension. Although mercurial and git have some of the same problems around large files, and both try to solve them in similar ways (standin files using mostly hashes of the real content).
* To install on debian :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
Debian unstable and testing are usually fairly up to date, so this should be enough: $sudo apt install git-annex $sudo apt -t jessie-backports install git-annex #Debian 7.0 "wheezy": $sudo apt-get install git-annex # #Follow the instructions to enable backports. $sudo apt-get -t wheezy-backports install git-annex #Debian 6.0 "squeeze" Follow the instructions to enable backports. $sudo apt-get -t squeeze-backports install git-annex |
Repository Address :
https://downloads.kitenet.net/git-annex/linux/current/
History:
http://source.git-annex.branchable.com/?p=source.git;a=history;f=doc/install/Debian.mdwn;hb=HEAD
Git Hosting Sites :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Public Git hosting sites Here are some places that provide free Git hosting. Check on GitServer if you want to host your own repository. List is limited to sites that provide explicit Git hosting, not including generic hosting sites that can be used to host Git repositories. Provider Framework is open-source? Support for other SCM Open-source repositories Space (GB) Free private repositories Assembla No SVN/Hg/P4 Yes 0.15 1 project, 3 users Beanstalk No SVN No 0.1 1 projects, 1 user bitbucket.org No Mercurial Yes Unlimited Unlimited projects, 5 collaborators Codetidy No No No 0.1 5 repositories, 5 collaborators Codebase No Mercurial/SVN Public access available 0.05 1 project (unlimited repos), 2 collaborators CloudForge No CVS/SVN Yes 0.2 1 user only Deveo No Mercurial/SVN No Unlimited Unlimited projects, 6 collaborators GitEnterprise No No No 1 Unlimited projects, 10 collaborators GitHub No SVN Yes Unlimited No GitLab.com Yes No Yes Unlimited Unlimited projects, unlimited collaborators Pikacode No Mercurial Yes 1 No ProjectLocker No SVN Read-only http 0.2 1 project, 2 collaborators repo.or.cz Yes No Yes 0.4 No SourceForge.net Yes Hg, SVN Yes Unlimited No Unfuddle No SVN Yes 0.2 1 project, 2 collaborators Visual Studio Online No TFVC No Unlimited Unlimited, 5 users |

Alice und Bob synchronisieren über SSH ihre Repositories.
Command Line :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
git-annex Repo Alice Alice erstellt sich in ihrem Verzeichnis annex eine git-annex Repository: :~/annex$ git init Initialized empty Git repository in /home/alice/annex/.git/ :~/annex$ git annex init "Alice" init Alice ok (Recording state in git...) Sie fügt die Daten hinzu, die sie mit git-annex verwalten will: :~/annex$ cp ~/Downloads/debhelper-slides.pdf . :~/annex$ git annex add . add debhelper-slides.pdf (checksum...) ok (Recording state in git...) :~/annex$ git commit -a -m "Added slides" [master (root-commit) 761a810] Added slides 1 file changed, 1 insertion(+) create mode 120000 debhelper-slides.pdf Um sich mit Bob zu synchronisieren, fügt Sie dessen git-annex Repository als eine entferntes Repository hinzu:[3] :~/annex$ git remote add bob ssh://bob@192.168.56.104/home/bob/annex git-annex Repo Bob Bob klont sich das vorhandene Repo von Alice und initialisiert sein git-annex Repository mit seinem Namen: :~/annex$ git clone ssh://alice@192.168.56.1/home/alice/annex . Cloning into '.'... remote: Counting objects: 13, done. remote: Compressing objects: 100% (9/9), done. remote: Total 13 (delta 2), reused 0 (delta 0) Receiving objects: 100% (13/13), done. Resolving deltas: 100% (2/2), done. :~/annex$ git annex init "Bob" init Bob ok (Recording state in git...) Er fügt ebenfalls Alice als Remote hinzu: :~/annex$ git remote add alice ssh://alice@192.168.56.1/home/alice/annex Alice und Bob synchronisieren sich Alice und Bob können auf ihrer Seite über git annex sync ihre Repos aktualisieren und Neuerungen zum Partner pushen: :~/annex$ git annex sync bob commit ok pull bob remote: Counting objects: 5, done. remote: Compressing objects: 100% (3/3), done. remote: Total 5 (delta 0), reused 1 (delta 0) Unpacking objects: 100% (5/5), done. From ssh://192.168.56.104/home/bob/annex * [new branch] git-annex -> bob/git-annex * [new branch] master -> bob/master ok (merging bob/git-annex into git-annex...) (Recording state in git...) push bob Counting objects: 7, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 435 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To ssh://bob@192.168.56.104/home/bob/annex * [new branch] git-annex -> synced/git-annex * [new branch] master -> synced/master ok Hat Alice neue Dateien hinzugefügt, erhält Bob im ersten Schritt nur einen gebrochenen symbolischen Link, ohne die eigentlichen Daten der Datei: :~/annex$ git annex sync alice (merging synced/git-annex origin/git-annex into git-annex...) commit ok pull alice From ssh://192.168.56.1/home/alice/annex * [new branch] git-annex -> alice/git-annex * [new branch] master -> alice/master * [new branch] synced/master -> alice/synced/master ok Folgender find-Befehl listet gebrochene symbolische Links auf: :~/annex$ find -L . -type l ./git-pkg-2011.pdf Durch ein git annex get von Alice, kann er auch den Datei-Inhalt erhalten: :~/annex$ git annex get . get debhelper-slides.pdf (from alice...) SHA256E-s1988981--8aaa02dda217bbabd79a11a5f93fdd4ca8ae4e723c86b4bb91c69d4095a84006.pdf 1988981 100% 24.63MB/s 0:00:00 (xfer#1, to-check=0/1) sent 30 bytes received 1989376 bytes 265254.13 bytes/sec total size is 1988981 speedup is 1.00 ok (Recording state in git...) Alice kopiert Daten zu Bob :~/annex$ cp ~/Downloads/git-pkg-2011.pdf . :~/annex$ git annex add . add git-pkg-2011.pdf (checksum...) ok (Recording state in git...) :~/annex$ git commit -a -m "Added tutorial" [master 50c8091] Added tutorial 1 file changed, 1 insertion(+) create mode 120000 git-pkg-2011.pdf :~/annex$ git annex copy . --to bob copy debhelper-slides.pdf (checking bob...) ok copy git-pkg-2011.pdf (checking bob...) (to bob...) SHA256E-s359984--e87901d377b5c31377a87eb07a28cd133b07feed380f869867abb04bc85d3e47.pdf 359984 100% 52.01MB/s 0:00:00 (xfer#1, to-check=0/1) sent 360173 bytes received 31 bytes 720408.00 bytes/sec total size is 359984 speedup is 1.00 ok (Recording state in git...) Wenn Bob synchronisiert hat ist die Datei inkl. Inhalt bei ihm angelangt. Ohne git annex copy hätte Bob wieder nur einen gebrochenen symbolischen Link vorgefunden: :~/annex$ git annex sync commit ok pull origin :~/annex$ ls debhelper-slides.pdf git-pkg-2011.pdf Da Alice die Datei kopiert, befindet sie sich nun bei Alice und Bob: :~/annex$ git annex whereis . whereis debhelper-slides.pdf (2 copies) de5e57a3-4517-4a05-84ee-60708bbd9d3b -- here (Bob) e3d44122-8756-4f1c-aa5b-5ecdfe01bc4b -- origin (Alice) ok whereis git-pkg-2011.pdf (2 copies) de5e57a3-4517-4a05-84ee-60708bbd9d3b -- here (Bob) e3d44122-8756-4f1c-aa5b-5ecdfe01bc4b -- origin (Alice) ok |
Example Git Remote :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
Examples Add a new remote, fetch, and check out a branch from it $ git remote origin $ git branch -r origin/HEAD -> origin/master origin/master $ git remote add staging git://git.kernel.org/.../gregkh/staging.git $ git remote origin staging $ git fetch staging ... From git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging * [new branch] master -> staging/master * [new branch] staging-linus -> staging/staging-linus * [new branch] staging-next -> staging/staging-next $ git branch -r origin/HEAD -> origin/master origin/master staging/master staging/staging-linus staging/staging-next $ git checkout -b staging staging/master ... Imitate git clone but track only selected branches $ mkdir project.git $ cd project.git $ git init $ git remote add -f -t master -m master origin git://example.com/git.git/ $ git merge origin |
References:
http://git-annex.branchable.com/
https://downloads.kitenet.net/git-annex/linux/current/
https://www.thomas-krenn.com/de/wiki/Git-annex