c5fb7e5de5d69c6ea0d3d284d6ebf24ecefb52c3
[git-annex.git] /
1 [[!comment format=mdwn
2  username="kyle"
3  avatar="http://cdn.libravatar.org/avatar/7d6e85cde1422ad60607c87fa87c63f3"
4  subject="a reduced script"
5  date="2019-07-11T20:19:23Z"
6  content="""
7 ```
8 #!/bin/sh
9
10 cd $(mktemp -dt gx-XXXXXXX)
11
12 git init a
13 cd a
14 git annex init --version=7
15 echo foo >foo
16 git add foo
17 git commit -mfoo
18
19 cd ..
20 git clone a b
21 cd b
22
23 git checkout HEAD^{}
24 git annex init
25 git annex upgrade
26
27 git annex get foo
28 cat foo
29
30 ```
31
32 Output:
33
34 ```
35 Initialized empty Git repository in /tmp/gx-RqdQyBF/a/.git/
36 init  ok
37 (recording state in git...)
38 (recording state in git...)
39 [master (root-commit) 2b5f739] foo
40  1 file changed, 1 insertion(+)
41  create mode 100644 foo
42 Cloning into 'b'...
43 done.
44 Note: checking out 'HEAD^{}'.
45
46 You are in 'detached HEAD' state. You can look around, make experimental
47 changes and commit them, and you can discard any commits you make in this
48 state without impacting any branches by performing another checkout.
49
50 If you want to create a new branch to retain commits you create, you may
51 do so (now or later) by using -b with the checkout command again. Example:
52
53   git checkout -b <new-branch-name>
54
55 HEAD is now at 2b5f739 foo
56 init  (merging origin/git-annex into git-annex...)
57 ok
58 (recording state in git...)
59 upgrade (v5 to v6...) (v6 to v7...) ok
60 get foo (from origin...) (checksum...) ok
61 (recording state in git...)
62 /annex/objects/SHA256E-s4--b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
63
64 ```
65 """]]