From ebaa5957d86de16aabb9e323915ae46be0969b8b Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 30 Sep 2024 16:38:45 -0500 Subject: added a note about resetting a single directory in git/gitannex --- tech/git-reset-folder.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tech/git-reset-folder.txt diff --git a/tech/git-reset-folder.txt b/tech/git-reset-folder.txt new file mode 100644 index 0000000..ca5571d --- /dev/null +++ b/tech/git-reset-folder.txt @@ -0,0 +1,9 @@ +git restore --source=HEAD --staged --worktree -- mydir + +# or, shorter + +git restore -s@ -SW -- mydir + +That would replace both the index and working tree with HEAD content, like an reset --hard would, but for a specific path. + +Works on git annex as well -- cgit v1.2.3-70-g09d2