Hello,
I use to be able to upload my GIT site files, deploy to my server automatically so I did the following:
1 - I created a GIT repository on my server, outside the public_html folder 2 - then created a post-receive file inside the hooks directory of my repository, where it deploy to my server, with the following line
GIT_WORK_TREE=/home/diretorio/public_html git checkout -f
But I have some problems and I do not know how to solve, they are:
Image files
- I have a directory of user images in assets / img / users /, the problem is that every time I do a PULL to my repository on my server this directory is "zeroed" since the files that are on the server do not are on my machine
Question:
- How do I prevent this directory from being updated in deploy? already tried to use .gitignore but did not work
Certain directories can not be in deploy
- At my place of work I have a GIT server too, where we make all the PULL of our applications for other developers to work on, so all our projects have all the files we work with, including the database diagram file
- This diagram file is in the / sql / diagram-name folder that is inside my project structure
- When I do a PULL to our internal GIT server this folder has to be sent normally because it is a working file that another developer can use, but when I do the PULL to the production server, it automatically performs the DEPLOY this folder can not be sent to DEPLOY
Question
- How can I make sure that the / sql folder when performing PULL for the production server is not included in the DEPLOY action and then copied to the web server?
- I've tried using the GIT command --exclude = / home / directory / folder but it does not work
Who can help me and give me a light?
Thank you