forked from
gazagnaire.org/irmin
Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
1Irmin CLI - content-addressed storage
2
3 $ export TERM=dumb
4 $ chmod +x normalize
5
6Create a new repository:
7
8 $ mkdir testrepo
9 $ cd testrepo
10 $ irmin init . | sed 's/at .*/at PATH/'
11 ✓ Initialised Git repository at PATH
12
13Check branches (initially empty):
14
15 $ irmin branches
16
17Add content:
18
19 $ irmin set README.md '# Hello World' -m 'Initial commit' | ../normalize
20 ✓ HASH
21
22Get content back:
23
24 $ irmin get README.md
25 # Hello World
26
27List paths:
28
29 $ irmin list
30 README.md
31
32Show tree:
33
34 $ irmin tree
35 README.md
36
37Show log:
38
39 $ irmin log | ../normalize
40 HASH irmin <irmin@local>
41 Initial commit
42
43
44
45
46
47JSON output mode:
48
49 $ irmin get README.md -o json
50 {"path":"README.md","content":"# Hello World"}
51
52 $ irmin list -o json
53 [{"name":"README.md","type":"file"}]
54
55Add nested content:
56
57 $ irmin set src/main.ml 'let () = ()' -m 'Add source' | ../normalize
58 ✓ HASH
59
60 $ irmin list
61 README.md
62 src/
63
64 $ irmin list src/
65 main.ml
66
67 $ irmin tree
68 README.md
69 src/
70 main.ml
71
72Delete content:
73
74 $ irmin del README.md -m 'Remove readme' | ../normalize
75 ✓ HASH
76
77 $ irmin list
78 src/
79
80Show commit history:
81
82 $ irmin log -n 2 | ../normalize
83 HASH irmin <irmin@local>
84 Remove readme
85
86 HASH irmin <irmin@local>
87 Add source
88
89
90
91
92
93
94
95Create and switch to a new branch:
96
97 $ irmin checkout -c feature | sed 's/branch .*/branch BRANCH/'
98 ✓ Created branch BRANCH
99
100 $ irmin branches
101 main
102 feature
103
104 $ irmin checkout main | sed 's/branch .*/branch BRANCH/'
105 ✓ Switched to branch BRANCH