How to Install GIT on GoDaddy Server on Linux?
Last Updated :
25 Jun, 2024
Git is a widely-used version control system that allows developers to track changes, collaborate on projects, and manage code repositories efficiently. If you’re hosting your projects on a GoDaddy server running Linux, installing Git can simplify your development workflow. This guide will walk you through the steps to install Git on a GoDaddy Linux server.
Prerequisites
Before you start, ensure you have the following:
Steps to Install GIt on GoDaddy Server
Step 1: Enable SSH into your GoDaddy VPS.
$ ssh user@ip

Install GIT on GoDaddy Server on Linux
Step 2: Before installing mongo, update and upgrade your server.
$ sudo apt update && apt upgrade

Install GIT on GoDaddy Server on Linux

Install GIT on GoDaddy Server on Linux
Step 3: Install git from the apt package.

Install GIT on GoDaddy Server on Linux
Step 4: Verify the installation by running
$ git --version

Install GIT on GoDaddy Server on Linux
Configuring and using GIT
Step 1: Update git configuration settings by adding your email and username to the commit.
$ git config --global user.email "email"
$ git config --global user.name "username"

Install GIT on GoDaddy Server on Linux
Step 2: Generate a personal access token by visiting https://github.com/settings/tokens. Make sure to give the required privileges to the token. You can also refer to Using GitHub with SSH for a more clutter-free experience while pulling and pushing changes.
Step 3: Clone the repository using ssh if you have added the ssh key to your GitHub/GitLab account, otherwise use HTTPS.
$ git clone <repo_url>

Install GIT on GoDaddy Server on Linux
Step 4: Now, you can create, update or delete any file in our cloned repository. But for now, I am creating a simple text file. You can track the changes using the git status command.
$ echo'Geeks For Geeks' >> new.txt

Install GIT on GoDaddy Server on Linux
Step 5: Commit the new file and push the changes to the main branch.
$ git add .
$ git commit -m "relevant message"
$ git push origin branch_name

Install GIT on GoDaddy Server on Linux
Step 6: Verify the commit in the git logs or by viewing commit history on Github/GitLab.
$ git log

Install GIT on GoDaddy Server on Linux

Install GIT on GoDaddy Server on Linux
Note: You can also visit the List of useful Github Commands for a better understanding of git workflow
Please Login to comment...