我想建立一個系統,當我提交更改到我的GitHub存儲庫時,我的服務器也收到這些提交。在rails控制器git命令
要做到這一點,我設置了我的GitHub倉庫,以發送post-receive鉤子到我的rails應用程序中的URL。我有一個控制器可以處理這個問題。
問題是這樣的:我如何在rails控制器中運行git命令?我知道如何在命令行中完成它。
難道我只需鍵入是這樣的:
# controller method where post-receive hook is sent
def commit
git pull origin development
end
[Making git auto-commit](http://stackoverflow.com/questions/420143/making-git-auto-commit) – user2205763