diff options
author | https://id.koumbit.net/anarcat <https://id.koumbit.net/anarcat@web> | 2013-09-10 18:11:46 +0000 |
---|---|---|
committer | admin <admin@branchable.com> | 2013-09-10 18:11:46 +0000 |
commit | 4471638a0433874b1be004e166f1ca55cd828f44 (patch) | |
tree | 9f8700c44f7f93884751e5fc6c0c26ba1d0b38a7 | |
parent | 307a4f72623bf8cc3677a6328419b24f44667772 (diff) |
this may seem trivial, but i went freaking crazy with this
-rw-r--r-- | doc/tips/migrating_two_seperate_disconnected_directories_to_git_annex.mdwn | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/doc/tips/migrating_two_seperate_disconnected_directories_to_git_annex.mdwn b/doc/tips/migrating_two_seperate_disconnected_directories_to_git_annex.mdwn new file mode 100644 index 000000000..3d7e9dac4 --- /dev/null +++ b/doc/tips/migrating_two_seperate_disconnected_directories_to_git_annex.mdwn @@ -0,0 +1,53 @@ +Scenario +-------- + +You are a new git-annex user. You have already files spread around many computers and wish to migrate those into git-annex, without having to recopy all files all over the place. + +Let's say, for example, you have a server, named `marcos` and a workstation named `angela`. You have your audio collection stored in `/srv/mp3` in `marcos` and `~/mp3` on `angela`, but only `marcos` has all the files, and `angela` only has a subset. + +We also assume that `marcos` has an SSH server. + +How do you add all this stuff to git-annex? + +Create the biggest git-annex repository +--------------------------------------- + +Start with `marcos`, with the complete directory: + + cd /srv/mp3 + git init + git annex init + git annex add + +You may want to use [[direct mode]] if you want to avoid creating a forest of symlinks there, but this is generally error-prone and should be avoided. + +This will checksum all files and add them to the `git-annex` branch of the git repository. Wait for this process to complete. + +Create the smaller repo and synchronise +--------------------------------------- + +On `angela`, we want to synchronise the git annex metadata with `marcos`. We need to initialize a git repo with `marcos` as a remote: + + cd ~/mp3 + git init + git remote add marcos marcos.example.com:/srv/mp3 + git fetch marcos + git annex status # this should display the two repos + git annex add . + +This will, again, checksum all files and add them to git annex. Once that is done, you can verify that the files are really the same as marcos with `whereis`: + + git annex whereis + +This should display something like: + + whereis Orange Seeds/I remember.wav (2 copies) + b7802161-c984-4c9f-8d05-787a29c41cfe -- marcos (anarcat@marcos:/srv/mp3) + c2ca4a13-9a5f-461b-a44b-53255ed3e2f9 -- here (anarcat@angela) + ok + +Once you are sure things went on okay, you can synchronise this with `marcos`: + + git annex sync + +This will push the metadata information to marcos, so it knows which files are available on `angela`. From there on, you can freely get and move files between the two repos! |