summaryrefslogtreecommitdiff
path: root/doc/bugs/clean-duplicates_causes_data_loss/comment_1_0c5da8b1285d16967a0423a0e259e06b._comment
blob: 689cef97a2eee6131f7339618b1f9c153199c883 (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
[[!comment format=mdwn
 username="CandyAngel"
 subject="comment 1"
 date="2015-04-24T11:57:35Z"
 content="""
Command to exemplify the \"worst case\" (untrusted causing deletion):

    mkdir /tmp/ga-icd
    cd /tmp/ga-icd

    git init origin
    cd origin
    git commit -m create
    git annex init origin
    echo a > a
    echo b > b
    git annex add .
    git commit -m files

    mkdir /tmp/ga-icd/importme
    echo a > a
    echo b > b
    echo c > c

    cd /tmp/ga-icd
    git clone origin import
    git annex init import

So we now have origin (with content for 2 files), import which knows origin has content for both files and directory we want to clean up. The following causes 'b' to be lost (hope you have backups!).

    cd /tmp/ga-icd/origin
    git annex drop b --force
    cd /tmp/ga-icd/import
    git annex untrust origin
    git annex import --clean-duplicates /tmp/ga-icd/importme
"""]]