Looking for .git advice with cPanel

Tom Flanagan

Registered
Mar 10, 2016
1
0
1
Bridgeview IL
cPanel Access Level
Reseller Owner
Hello,

I have a cPanel installation with git installed on the server and I am able to clone/checkout/pull ok but I manually have to copy/rsync files to public_html which feels very cumbersome. On past servers I believe that we set up our git project directory like project_name->docroot. We then checked out our project above public_html and then we had a symlink in public_html that pointed to our docroot folder in the .git repository. I would think that we just make public_html->symlink the docroot but our hosting company is very skittish about doing anything with public_html. Am I just thinking about this the wrong way? The hosting company has not been able to provide any insight on best practices for this.

-Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

The following third-party URL offers a useful guide on this:

Namecheap.com Knowledgebase • How to deal with Git on our shared servers (SSH Access)

Rather than creating a symbolic link from the public_html directory, it might be easier to simply change the document root of the account. Your hosting provider can do this by modifying the configuration file for the account in the /var/cpanel/userdata/$username directory.

Thank you.