summaryrefslogtreecommitdiff
path: root/doc/bugs/Assistant_doesn__39__t_actually_sync_file_contents_by_default/comment_6_ced397b9e6119a0798a282ee07e885df._comment
blob: 61d5f9bd25e17b2e4fbeac58f09e46a698ccc92d (plain)
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
[[!comment format=mdwn
 username="http://joeyh.name/"
 nickname="joey"
 subject="comment 6"
 date="2013-05-20T16:22:18Z"
 content="""
Here is a simple example of setting up 2 repositories in the way the bug reporter describes here and on IRC. As you can see, the assistant syncs file content without any configuration:

[[!format sh \"\"\"
joey@gnu:~/tmp/test>mkdir 1 2
joey@gnu:~/tmp/test>cd 1; git init; git-annex init; git annex direct; echo \"file added to 1\" > file_from_1; cd ..
Initialized empty Git repository in /home/joey/tmp/test/1/.git/
init  ok
(Recording state in git...)
commit  
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use \"git add\" to track)
ok
direct  ok
joey@gnu:~/tmp/test>cd 2; git init; git-annex init; git annex direct; echo \"file added to 2\" > file_from_2; cd ..
Initialized empty Git repository in /home/joey/tmp/test/2/.git/
init  ok
(Recording state in git...)
commit  
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use \"git add\" to track)
ok
direct  ok
joey@gnu:~/tmp/test>cd 1; git remote add 2 ssh://localhost/~joey/tmp/test/2; git annex assistant; cd ..
joey@gnu:~/tmp/test>cd 2; git remote add 1 ssh://localhost/~joey/tmp/test/1; git annex assistant; cd ..
(merging synced/git-annex into git-annex...)
(Recording state in git...)
joey@gnu:~/tmp/test>cd 1
joey@gnu:~/tmp/test/1>ls
file_from_1
joey@gnu:~/tmp/test/1>ls
file_from_1  file_from_2
joey@gnu:~/tmp/test/1>cat file_from_2
file added to 2
joey@gnu:~/tmp/test/1>cd ..
joey@gnu:~/tmp/test>cd 2
joey@gnu:~/tmp/test/2>cat file_from_1
file added to 1
joey@gnu:~/tmp/test/2>rm file_from_2
joey@gnu:~/tmp/test/2>cd ..
joey@gnu:~/tmp/test>cd 1
joey@gnu:~/tmp/test/1>ls
file_from_1
joey@gnu:~/tmp/test/1>date > newfile
joey@gnu:~/tmp/test/1>cd ..
joey@gnu:~/tmp/test>cd 2
joey@gnu:~/tmp/test/2>cat newfile
Mon May 20 12:20:24 JEST 2013
\"\"\"]]
"""]]