I'm trying to figure out how to do the following (and figure out if it's even possible).
I have a local git repo with a number of folders for various things, but I want to be able to deploy my website with git to my development server and really only the contents of one folder should go into the remote webroot (just the content of the folder, not the folder itself, that's the tough bit). I have the git push to the dev server going into a bare repo outside of the web accessible folders, and then I am using a post-receive script to place all the working files into the webroot. However, this copies all the folders and obviously I only want the contents of one specific folder to move after the operation is completed.
Doing some research, it looks like sparse-checkout would be a good fit. UPDATE: I have it working now where it will copy just a specific folder, but I still haven't gotten it to ignore the folder itself and just pull the contents. I figure this is something having to do with the paths/wildcards I add to .git/info/sparse-checkout, but I'm not sure what the pattern is for excluding a directory but not excluding its contents.
Is there a good way to do this? Should I just use the post-receive script to manually copy the contents of the directory I want rather than trying to do it directly using sparse checkout?
I am grateful for any help anyone is willing to give. Thanks!