summaryrefslogtreecommitdiff
path: root/doc/bugs/git_annex_import_is_dangerous_if_you_have_unused_objects/comment_1_9f9d5c18c27dfd33a5bf2c593ee65b58._comment
blob: aac409e98367c7307290a878f356cbb0c0310537 (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
[[!comment format=mdwn
 username="joey"
 subject="""comment 1"""
 date="2017-03-02T21:20:02Z"
 content="""
A simpler way to get to the same end result, without using git-annex
import:

	mv ~/foo .
	git annex add foo
	git reset --hard

Now "foo" is only present in the git-annex object store, and we don't
know what its filename(s) were. 

A way to get to the same end result, without using git-annex:

	mv ~/foo .
	git add foo
	git reset --hard

Now "foo" is only present in the git object store, and we don't
know what its filename(s) were.

So, it's not `git-annex import`, or `git-annex add`, or `git add`
that is dangerous here. It's `git reset --hard`.

git will happily lose lots of data until you commit it. Once it's
committed, it's safe. That's the rule of thumb. Nothing much that git-annex
can do about that.
"""]]