I am trying to figure out how to do the following (and find out if this is possible).
I have a local git repository with several folders for different things, but I want to be able to deploy my site with git on my development server, and in fact only the contents of one folder should go to the remote webroot (just the contents of the folder, not the folder itself is a hard bit). I have git push to a dev server going to a bare repo outside of available web folders, and then I use a post-receive script to put all the working files in webroot. However, this copies all the folders and, obviously, I want the contents of one particular folder to move after the operation is completed.
By doing some research, it seems like a sparse check will be a good fit. UPDATE: now I work when it copies only a specific folder, but I still have not received it to ignore the folder and just pull out the contents. I believe this is due to the paths / wildcards that I add to .git / info / sparse-checkout, but I'm not sure if the template is to exclude the directory, but not exclude its contents.
Is there a good way to do this? Should I just use a post-receive script to manually copy the contents of the directory I want, and not try to do it directly using a rare check?
I am grateful for any help anyone wishes to give. Thank you
source
share