Answer the question
In order to leave comments, you need to log in
How to write a hook to update a git repository after adding files to it?
Hosted with Git. There is a central repository, the rep (master) is cloned from it to the www folder (the web server looks there). Some user files are periodically added to the www/files folder.
It is necessary to write a hook that, after each addition of a file to www/files, makes a commit and push to the central rep.
I'm still new to Git, so I'm asking for some advice.
Thank you.
Answer the question
In order to leave comments, you need to log in
You want something weird. There is no such hook because it is not a hook. You can of course write a script like
cd /work/dir
git add -A
git commit -m "automatic commit"
git push origin master
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question