skip to Main Content

We have 5 people working on a project in our company. Everyone syncs their respective code to Gitlab. Every time we are copying and pasting the contents from local machine/Gitlab to production server to make our application work. We wish to sync Gitlab code to our cPanel server without installing Git on cPanel server.

Is this possible?

What we want is that as soon as we wish to sync our Gitlab code with cPanel server code, some script or some privilege should be given so that the updated Gitlab code updates the code on the cPanel server.

2

Answers


  1. Git is automatically provided by the cPanel system to end users. They should already be able to use git.

    Login or Signup to reply.
  2. You can do only two commands in cPanel such as git pull and git push

    Based on this documentation cPanel

    Create the .cpanel.yml file with following code

    ---
    deployment:
     tasks:
     - export DEPLOYPATH=/home/user/public_html/
     - /bin/cp index.html $DEPLOYPATH
     - /bin/cp style.css $DEPLOYPATH
    

    Add the cPanel-managed repository as a remote.

    git remote add origin URL
    

    Push changes to the cPanel-managed repository.

    git push -u origin HEAD
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search