The Git™ Version Control feature allows you to easily host Git repositories on your cPanel account, and, in cPanel & WHM version 74 and later, includes deployment support. Generally, deployment sends finished code into production. You can use different configurations to automatically (push deployment) or manually (pull deployment) deploy changes.
Music by bensound.com
greetings this is Sarah can I write ER in the documentation team at cPanel the hosting platform of choice today I'm going to show you how to deploy your code automatically using the git version control interface in cPanel and whm version 74 this feature allows you to easily host git repositories on your cPanel account and starting in version 74 supports both push or automatic and pull or manual deployment kits version control software tracks changes in a system of files that multiple users can manage simultaneously deployment performs the tasks to move those changes into production for example if you're a web developer you could use a cPanel hosted repository for development and then deploy changes to your public website whenever you're ready the first step to configuring deployment is to decide which type of deployment your project needs with push or automatic deployment you first pull new changes from a remote repository to your local computer then you can push those changes to your cPanel managed repository cPanel will deploy the changes automatically whenever it receives them using the commands that you configured for deployment this is the type of deployment that we recommend you use and it's the type that I'll show you in this video with pull or manual deployment you first push new changes from your local computer to the remote repository then you can use the cPanel interface to deploy those changes manually with just a couple of clicks if you want to use this style of deployment check out our other deployment video for everything you need to know let's go ahead and setup a repository for push or automatic deployment first you want to setup the repository that your cPanel account will host for push deployment that means creating a new empty repository if you need help doing this check out our main get version control you once you've got your C panel hosted repository created you want to clone the remote repository to your local computer you can do this on the command line of your local computer with the git clone command and your remote repositories clone URL clone URLs usually look something like this so for this clone URL I'd run this command and if everything's successful I'll get a message like this the dot cPanel yamo file tells cPanel what to do during deployment so setting that up is next it needs to be a valid yeah mol file and start with these three lines up here then you add whichever commands you'd like cPanel to run as a list like this to use this file cPanel needs the file to be checked into the top-level directory of your repository you can create and commit it to your local computers copy of the repository or you can create and commit it on the remote repository of course to check it into the remote repository you'll need readwrite access or the ability to submit a pull request to the remote repository once you've got that file committed and ready to go let's go back to the cPanel interface and find the cPanel hosted repositories clone URL the quickest way to find that is to expand the repositories information in the list of repositories click copy here to copy the clone URL to your clipboard then use it in this command this will add the cPanel hosted repository as the repository on your local computers remote so that it will be the location your local computer pushes changes to now you can use the git push command to send changes to the cPanel hosted repository every time that you do this cPanel will use the commands in your dot cPanel Amal file to deploy your C panel hosted repository for more information about cpanel visit cpanel comm or follow at cpanel on twitter thanks for watching and happy automating