I would like first to thank you ! Everytime I get stuck I always find a solution here. So thanks a lot !
But this time I need to ask a question : I am currently building a small website with a web interface where admin can change text saved in the sqlite database. I use git locally and to deploy to the server, and a post-receive hook in the bare repo on the server to checkout files in another directory. This dir is then used by nginx and gunicorn to serve the flask app and the files.
Everything works fine for the moment but I had a question : as the database is stored in a file (sqlite) in another directory than the repo, how can I fetch the changes made on the remote file to my local development repo ? Also the user can upload pictures that are rendered on the website, but how can I fetch them to my local repo. Should I init a repo in the directory I could then fetch ? Or is there another solution ?
I know this question may be silly but I am beginning with databases and web interfaces. Thank you in advance for any help !
As I understand, you have the following setup:
L
is pushed to remoteR
R
toU
, which is served by HTTP serverU
with new contentU
to localL
I'm assuming that
U
is a clone ofR
. You can just fetch changes fromU
to your localL
- no problem here, as all commits made by the user have the same parent commit as you have in your localL
. The only troublesome part is to commit changes made by the user inU
. You'll probably need to do some scripting there, so if the user uploads some content - say, via ftp -git commit
is fired. RepositoryU
must be accessible somehow -ssh
seems to be a good idea in this setup.