document using ssh remotes
This commit is contained in:
parent
26005d23ba
commit
e6048b0389
2 changed files with 40 additions and 8 deletions
2
debian/control
vendored
2
debian/control
vendored
|
@ -10,7 +10,7 @@ Homepage: http://git-annex.branchable.com/
|
||||||
Package: git-annex
|
Package: git-annex
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Section: utils
|
Section: utils
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}, git | git-core, uuid
|
Depends: ${misc:Depends}, ${shlibs:Depends}, git | git-core, uuid, openssh-client
|
||||||
Description: manage files with git, without checking their contents into git
|
Description: manage files with git, without checking their contents into git
|
||||||
git-annex allows managing files with git, without checking the file
|
git-annex allows managing files with git, without checking the file
|
||||||
contents into git. While that may seem paradoxical, it is useful when
|
contents into git. While that may seem paradoxical, it is useful when
|
||||||
|
|
|
@ -13,8 +13,8 @@ This is very straightforward. Just tell it a description of the repository.
|
||||||
|
|
||||||
## adding a remote
|
## adding a remote
|
||||||
|
|
||||||
This could be a USB drive, or a sshfs or NFS mount to a file server, for
|
Like any other git repository, git-annex repositories have remotes.
|
||||||
example.
|
Let's start by adding a USB drive as a remote.
|
||||||
|
|
||||||
# sudo mount /media/usb
|
# sudo mount /media/usb
|
||||||
# cd /media/usb
|
# cd /media/usb
|
||||||
|
@ -25,11 +25,8 @@ example.
|
||||||
# cd ~/annex
|
# cd ~/annex
|
||||||
# git remote add usbdrive /media/usb
|
# git remote add usbdrive /media/usb
|
||||||
|
|
||||||
This is all standard ad-hoc distributed git repository setup. Or you
|
This is all standard ad-hoc distributed git repository setup.
|
||||||
could have added a centralized bare repository on a server if you prefer
|
The only git-annex specific part is telling it the name
|
||||||
doing things that way.
|
|
||||||
|
|
||||||
Anyway, the only git-annex specific part is telling it the name
|
|
||||||
of the new repository created on the USB drive.
|
of the new repository created on the USB drive.
|
||||||
|
|
||||||
Notice that both repos are set up as remotes of the other one. This lets
|
Notice that both repos are set up as remotes of the other one. This lets
|
||||||
|
@ -151,6 +148,41 @@ makes it very easy.
|
||||||
# git annex move my_cool_big_file --to usbdrive
|
# git annex move my_cool_big_file --to usbdrive
|
||||||
move my_cool_big_file (to usbdrive...) ok
|
move my_cool_big_file (to usbdrive...) ok
|
||||||
|
|
||||||
|
## using ssh remotes
|
||||||
|
|
||||||
|
So far git-annex has been used with a remote repository on a USB drive.
|
||||||
|
But it can also be used with a remote that is truely remote, a host
|
||||||
|
accessed by ssh.
|
||||||
|
|
||||||
|
Say you have a desktop on the same network as your laptop and want
|
||||||
|
to clone the laptop's annex to it:
|
||||||
|
|
||||||
|
# git clone ssh://mylaptop/home/me/annex ~/annex
|
||||||
|
# cd ~/annex
|
||||||
|
# git annex init "my desktop"
|
||||||
|
|
||||||
|
Now you can get files and they will be transferred by `scp`:
|
||||||
|
|
||||||
|
# git annex get my_cool_big_file
|
||||||
|
get my_cool_big_file (getting UUIDs for origin...) (copying from origin...)
|
||||||
|
my_cool_big_file 100% 2159 2.1KB/s 00:00
|
||||||
|
ok
|
||||||
|
|
||||||
|
When you drop files, git-annex will ssh over to the remote and make
|
||||||
|
sure the file's content is still there before removing it locally:
|
||||||
|
|
||||||
|
# git annex drop my_cool_big_file
|
||||||
|
drop my_cool_big_file (checking origin..) ok
|
||||||
|
|
||||||
|
Note that normally git-annex prefers to use non-ssh remotes, like
|
||||||
|
a USB drive, before ssh remotes. They are assumed to be faster/cheaper to
|
||||||
|
access, if available. There is a annex-cost setting you can configure in
|
||||||
|
`.git/config` to adjust which repositories it prefers. See
|
||||||
|
[[the_man_page|git-annex]] for details.
|
||||||
|
|
||||||
|
Also, note that you need full shell access for this to work --
|
||||||
|
git-annex needs to be able to ssh in and run commands.
|
||||||
|
|
||||||
## using the URL backend
|
## using the URL backend
|
||||||
|
|
||||||
git-annex has multiple key-value [[backends]]. So far this walkthrough has
|
git-annex has multiple key-value [[backends]]. So far this walkthrough has
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue