Git Repositories in cPanel

Git Repositories in cPanel:
Git is a version control system for tracking, maintaining and updating the conflict free changes in the project, which are done by all the developers working on the project.
cPanel is an online Linux-based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site.
cPanel now officially provide the support to host Git Repos over the web servers. You can also manage the cPanel Git Repos either through the cPanel’s Git Version’s Control Option or also by using the commands after SSH to the server. Also, all the necessary required documentation for using Git in cPanel is available at official cPanel Documentation.

https://tezhost.com/wp-content/uploads/2018/08/cpanel-git-1-300x200.png

https://tezhost.com/wp-content/uploads/2018/08/cpanel-git-2-300x109.png
https://tezhost.com/wp-content/uploads/2018/08/cpanel-git-3-300x150.png
At this step, you have successfully created the Git repo in cPanel.
Note: You may also create Git repo at cPanel by SSH and to server and using commands as mentioned below:
Once you have logged into the Server via SSH using any tool like PuTTY.


Type this command in the directory that you want to use as Git Repo:
git init
Now you have successfully created the Git Repo on Web Server, using commands, instead of GUI.

In the next step, as a Case 1, you will either clone your existing local computer’s Git Repo to Git Repo Created on Server / cPanel
OR
As a case 2, you will clone the cPanel / Web Server’s Git Repo to your local PC’s newly created Git Repo.
The steps for both cases are described below:
Case 1: To PUSH Local Repo to cPanel Repo
Step 1: Navigate to your repository’s directory by this command:
cd /path/to/your/repo
Step 2: Configure your local repository to push to the cPanel hosted repository:
Command 1:
git remote add origin ssh://[cPanelLoginUserName]@[WebsiteName]/[RepoPath]/[RepoName]
Command 2:
git push -u origin master
Case 2: To clone cPanel’s Git Repo to Local Git Repo:
Step 1: Clone the cPanel-hosted repository to your local computer and navigate to its directory:

git clone ssh://[cPanelLoginUserName]@[WebsiteName]/[RepoName]
Change your location to Git Repo Directory
cd [RepoName]
Step 2: Create a README file:
echo “# README” >> README.md
Step 3: We enable the update, called as Staging the Update, in order to commit it then
git add README.md
Step 4: Commit the README file to the project:
git commit -m “Initial Commit”
Step 5: Push the Commit to Head Branch, hosted over cPanel Git
git push -u origin master


Comments

Popular posts from this blog

What is Web hosting?

THE DIFFERENCE BETWEEN UNIQUE IPS AND SHARED IPS

What is Dedicated Hosting?