I have been using post-receive scripts in my git repositories with the following commands to checkout all of the files in the repository:
#!/bin/sh
GIT_WORK_TREE=/var/www/www.example.org git checkout -f
I am wanting to do something similar but only checkout the files that have been modified or added in the push. Once the files have been checked out the post-receive script will then run some other commands on these files and remove the files at the end so that the directory will be empty.
Is this possible?
you can use
git diffto give you a list of filesin a post-receive hook that’ll be I think
as this hook receives
oldrev,newrevandrefon standard input