From f165e4aa997ecb34e2f225d405781a1789806d75 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 31 Dec 2011 14:50:40 -0400 Subject: add section on syncing to the walkthrough --- doc/walkthrough.mdwn | 1 + doc/walkthrough/getting_file_content.mdwn | 10 ---------- doc/walkthrough/syncing.mdwn | 25 +++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 doc/walkthrough/syncing.mdwn diff --git a/doc/walkthrough.mdwn b/doc/walkthrough.mdwn index 68f94a6f2..f93e28393 100644 --- a/doc/walkthrough.mdwn +++ b/doc/walkthrough.mdwn @@ -8,6 +8,7 @@ A walkthrough of the basic features of git-annex. adding_files renaming_files getting_file_content + syncing transferring_files:_When_things_go_wrong removing_files removing_files:_When_things_go_wrong diff --git a/doc/walkthrough/getting_file_content.mdwn b/doc/walkthrough/getting_file_content.mdwn index cdb4a72e0..f41e17770 100644 --- a/doc/walkthrough/getting_file_content.mdwn +++ b/doc/walkthrough/getting_file_content.mdwn @@ -10,13 +10,3 @@ USB drive. # git annex get . get my_cool_big_file (from laptop...) ok get iso/debian.iso (from laptop...) ok - -Notice that you had to git fetch and merge from laptop first, this lets -git-annex know what has changed in laptop, and so it knows about the files -present there and can get them. - -The alternate approach is to set up a -[[central bare repository|tips/centralized_git_repository_tutorial]], and -always push changes to it after committing them, then in the above, -you can just pull from the central repository to get synced up to -all repositories. diff --git a/doc/walkthrough/syncing.mdwn b/doc/walkthrough/syncing.mdwn new file mode 100644 index 000000000..38f0f8acc --- /dev/null +++ b/doc/walkthrough/syncing.mdwn @@ -0,0 +1,25 @@ +Notice that in the [[previous example|getting_file_content]], you had to +git fetch and merge from laptop first. This lets git-annex know what has +changed in laptop, and so it knows about the files present there and can +get them. + +If you have a lot of repositories to keep in sync, manually fetching and +merging from them can become tedious. To automate it there is a handy +sync command, which also even commits your changes for you. + + # cd /media/usb/annex + # git annex sync + commit + nothing to commit (working directory clean) + ok + pull laptop + ok + push laptop + ok + +After you run sync, the repository will be updated with all changes made to +its remotes, and any changes in the repository will be pushed out to its +remotes, where a sync will get them. This is especially useful when using +git in a distributed fashion, without a +[[central bare repository|tips/centralized_git_repository_tutorial]]. See +[[sync]] for details. -- cgit v1.2.3