git - How to push code to webserver every time I make a commit to a branch? -


i have lamp stack (rhel 7, apache 2.4) on aws ec2 instance , webroot directory var/www/html. php code reside in remote private github repository (note: private repo). make automatic deployment such that, everytime commit branch (not master, branch), updated php file available on webserver.

how in simplest way? pls note, have verified have connectivity github aws ec2 instance , can install git client on ec2 instance.

use client side post-commit hook push it. see https://git-scm.com/book/en/v2/customizing-git-git-hooks. don't forget make .git/hooks/post-commit file executable , remember hook file isn't part of repo gets pushed server.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -