From 1e31a7c93ac995859d35455152e00a5097ff3e03 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 2 Mar 2017 17:24:49 -0400 Subject: [PATCH] show how this is not specific to git-annex at all --- ..._9f9d5c18c27dfd33a5bf2c593ee65b58._comment | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/bugs/git_annex_import_is_dangerous_if_you_have_unused_objects/comment_1_9f9d5c18c27dfd33a5bf2c593ee65b58._comment diff --git a/doc/bugs/git_annex_import_is_dangerous_if_you_have_unused_objects/comment_1_9f9d5c18c27dfd33a5bf2c593ee65b58._comment b/doc/bugs/git_annex_import_is_dangerous_if_you_have_unused_objects/comment_1_9f9d5c18c27dfd33a5bf2c593ee65b58._comment new file mode 100644 index 0000000000..aac409e983 --- /dev/null +++ b/doc/bugs/git_annex_import_is_dangerous_if_you_have_unused_objects/comment_1_9f9d5c18c27dfd33a5bf2c593ee65b58._comment @@ -0,0 +1,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. +"""]]