I’m building a website currently with a page for uploading images. The images will get uploaded to a repo, and be automatically renamed based on which input field it was uploaded through.
The repo is currently under version control via git, and what I’m doing is making the whole process a lot easier on non-technical PM’s. So I need to be able to pull, add, commit, and push all via the web interface I’ve created. Is there any way that could be done on an HTML5 website? I’m using PHP on the backend and a bunch of JQuery scripts to upload the files (though i’m still working on that part, can’t seem to figure it out completely yet).
The website should:
- git push
- git pull
- git add
- git commit
- git checkout to reset any uploaded files
- ^^^^^those should be done graphically (via an html button)
- output the git console output
- load images from the repo whenever “git pull” is pressed
- detect if a push has been made by another user while the current user is updating his set of files
Is there any way to send the server a signal to run git commands on the repo?
PHP’s shell_exec will allow you to execute arbitrary commands to the shell, although something like http://pear.php.net/package/VersionControl_Git will provide a better/safer interface.