I am trying to use git checkout-index
to 'export' files from a repository to another directory with source code as described in https://stackoverflow.com/a/160719/1068167
My git repository has the following structure:
./src/subproject/[files]
./src/subproject/subfolder1/[files]
./src/subproject/subfolder2/[files]
./src/subproject2/[files]
My first 'export' where I used the -a
flag worked perfectly. All my files and folders were 'exported' to the /tmp/export/src/...
as expected. This is the command I used:
git checkout-index -a -f --prefix=/tmp/export/src/
Now I am trying to update the export location with a subset of files that have changed since the last export. I do not want to export all files since I have deleted many files from other subfolders that should not be copied.
I am thinking something like this:
git checkout-index -f --prefix=/tmp/export/src/ -- ./src/subproject/*
This command copies the files in the 'subproject' folder but fails with a message the subfolders.
git checkout-index: src/subproject/subfolder1 is not in the cache
git checkout-index: src/subproject/subfolder2 is not in the cache
I was hoping that the following files and directories would be copied
/tmp/export/src/subproject/[files]
/tmp/export/src/subproject/subfolder1/[files]
/tmp/export/src/subproject/subfolder2/[files]
How can I export/checkout a given specified set of files and folders in my subproject so that all subfolders and their nested folders are copied as well?