I am having issue while creating repo into public_html folder. It says error like this.
Error: You cannot use the “/home/clientresearch/public_html” directory because it already contains files.
Is there any way to create repo into cPanel where there is already files. Right now it is only working into clean directory.
How can we make the git repo have the all file like live site?
Thank you in advance
2
Answers
You should keep the git clone and the
public_html
deployment folder separate.Cloning a source code base, and deploying its content are two separate steps.
That way, you can follow the CPanel guide “Guide to Git – Deployment“, which includes:
If you want the full content of the repo to be deployed, then check out the “Automatic or push deployment” section
I created a git repository by using the “Git Version Control” GUI in CPanel. You just “create”, and then add whatever directory you would like to use under the “repository path”. Give it a name, and then hit create. You can then add this as a remote repo