This question is related to:
Instead of detaching a single subdirectory, I want to detach a couple. For example, here is my folder structure:
/app1 /file1 /file2 /folder1 /folder2 /app2 /file3 /file4 /folder3 /folder4 /test /file5 /file6 /folder5 /folder6 /README.md /new_file And I would like this instead:
/app1 /file1 /file2 /folder1 /folder2 /app2 /file3 /file4 /folder3 /folder4 I have tried the below alternatives, and none have worked so far:
git filter-branch --index-filter 'git rm --cached -qr -- . && git reset -q $GIT_COMMIT -- /app1/* app2/*' --prune-empty -- --all Error: pathspec '.' did not match any files Second Try:
git filter-branch --tree-filter "mkdir samples; mv app1 app2 samples/" HEAD Error: rename app1 to samples/app1: No such file or directory Same error for the second sub-directory Any ideas?