I am using Git for simple website development and deployment.
I develop on localhost, pushing my changes to the server which deploys the web to the corresponding directory via posthook and
GIT_WORK_TREE=/var/www/website/httpdocs/ git checkout -f
My problem is that all user uploads on the live server (uploaded by the website users or via backend) get deleted which live in
/var/www/website/httpdocs/assets/uploads
How can I keep these files when automatically checking out/deploying the web without tracking them in my repository?
What you want to do is move your user upload directory outside webroot and symlink from webroot to the user upload directory.
For reference:
https://serverfault.com/questions/147185/website-deployment-managing-user-uploaded-content