Reputation: 127
Guys i use git to deploy changes to the live server.
Set up is bare repository outside of html folder with with following hook:
#!/bin/sh
GIT_WORK_TREE=/var/www/html git checkout -f
It updates changed files and creates new files, but it does not delete the deleted files.
How can i solve this?
Upvotes: 0
Views: 345
Reputation: 526813
Add this at the end:
GIT_WORK_TREE=/var/www/html git clean -df
The git clean
command is used to remove untracked files from a working directory; -f
is required for it to do anything, and -d
will make it remove untracked directories as well rather than leaving them empty.
Upvotes: 1