I have implemented a post-receive hook on my server (git was initialized with git init --bare
). Hook was created in the following way:
cd repo/hooks/
touch post-receive
chmod 777 post-receive
Then inside of the file I have:
#!/bin/sh
GIT_WORK_TREE=/var/www
export GIT_WORK_TREE
git checkout -f
Right now when I push my local changes everything gets moved to /var/www folder. The problem is that I do not want some of the folders to be moved. For example I have folder1
, and folder2
there which I do not want to be moved. Currently I am manually removing these folders after the push, but this is a ridiculous work and I would like to automate it.
I am on ubuntu 14.04
/ git 2.1