From be0574f608158935762398acac5ef837778c41c0 Mon Sep 17 00:00:00 2001 From: mitzip Date: Wed, 27 May 2015 21:33:42 +0000 Subject: Added a comment: proper usage of git annex proxy to mimic undo --depth --- .../comment_19_b851fbb0a86639770e6432c6431480a3._comment | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/direct_mode/comment_19_b851fbb0a86639770e6432c6431480a3._comment (limited to 'doc/direct_mode') diff --git a/doc/direct_mode/comment_19_b851fbb0a86639770e6432c6431480a3._comment b/doc/direct_mode/comment_19_b851fbb0a86639770e6432c6431480a3._comment new file mode 100644 index 000000000..4e0878b76 --- /dev/null +++ b/doc/direct_mode/comment_19_b851fbb0a86639770e6432c6431480a3._comment @@ -0,0 +1,15 @@ +[[!comment format=mdwn + username="mitzip" + subject="proper usage of git annex proxy to mimic undo --depth" + date="2015-05-27T21:33:42Z" + content=""" +Thanks for correcting that, and thanks for the git-revert suggestion! + +I saw this in the `git revert` docs and thought that `git checkout annex/direct/master~$depth` might best suit my needs of restoring a previous version of a file. (I liked the idea of presenting the user with a depth rather than a hash.) + +>Note: git revert is used to record some new commits to reverse the effect of some earlier commits (often only a faulty one). If you want to throw away all uncommitted changes in your working directory, you should see git-reset[1], particularly the --hard option. If you want to extract specific files as they were in another commit, you should see git-checkout[1], specifically the git checkout -- syntax. Take care with these alternatives as both will discard uncommitted changes in your working directory. + +What I've found is that your suggestion of `git revert` is nice because it wouldn't create a conflict, as `git checkout` does. So annex, thorough as it is, creates a $filename.variant-local.ext file after the conflict resolution to preserve the original. `git revert` is neater, history wise, because there is no conflict because git knows exactly what's changing and from when, rather than just some new file content showing up from who knows where with `git checkout`. The issue it seems is that `git revert` works on a commit basis, while `git checkout` can operate on files. If I'm correct in this, does annex use one commit per file, for sure, every time? If this is the case, there would be no problem using the better in most every other way `git revert`. + +Though, I'm still not clear how to use the \"depth\" referencing with `git revert` rather than hashes. +"""]] -- cgit v1.2.3