简体   繁体   English

将git版本控制功能集成到网站中

[英]Integrating git version control functionality into a website

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. 该仓库目前正在通过git进行版本控制,而我正在做的就是使非技术PM的整个过程变得更加容易。 So I need to be able to pull, add, commit, and push all via the web interface I've created. 因此,我需要能够通过我创建的Web界面进行拉,添加,提交和推送所有操作。 Is there any way that could be done on an HTML5 website? 在HTML5网站上可以采取任何方法吗? 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). 我在后端使用PHP和一堆JQuery脚本来上传文件(尽管我仍在处理该部分,但似乎还不能完全弄清楚)。

The website should: 该网站应:

  • git push git推
  • git pull git pull
  • git add git添加
  • git commit git提交
  • git checkout to reset any uploaded files git checkout重置所有上传的文件
  • ^^^^^those should be done graphically (via an html button) ^^^^^这些应该以图形方式完成(通过html按钮)
  • output the git console output 输出git控制台输出
  • load images from the repo whenever "git pull" is pressed 每当按下“ git pull”时,从仓库中加载图像
  • 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? 有什么方法可以向服务器发送信号以在仓库上运行git命令吗?

PHP的shell_exec将允许您对shell执行任意命令,尽管http://pear.php.net/package/VersionControl_Git之类的东西将提供更好/更安全的界面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM