summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2024-09-30 16:38:45 -0500
committerluxagraf <sng@luxagraf.net>2024-09-30 16:38:45 -0500
commitebaa5957d86de16aabb9e323915ae46be0969b8b (patch)
treef65acfdc4603fc345fd856f673192bb686c70597
parent16e361736f6ee5912022481f273bcbdbc7a6145f (diff)
added a note about resetting a single directory in git/gitannex
-rw-r--r--tech/git-reset-folder.txt9
1 files changed, 9 insertions, 0 deletions
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