It is important to remember that Git must be installed both on your local computer and at your remote server location. This article will show you how to install Git for Mac, Windows, and Linux operating systems along with your InMotion Hosting server.
VPS/Dedicated hosting plans come with Git pre-installed. For self-managed accounts, installing Git requires root access or superuser (sudo) privileges. You will also need to whitelist any IP address that requires SSH access to a Git repository.
How to Install Git On Your Computer
Be sure to check the specific version of your operating system. If you are using an older version of Mac OS X or Windows XP, consider upgrading, but be sure to check the downloadable archives for older versions of Git.
Mac OS X
Downloading git for your mac involves a simple procedure with which you are most likely familiar. You will download an executable installer file, open it, follow the steps, and you’re done. Follow along with the steps to see this process illustrated.
- Visit the Git downloads page to retrieve the installer file
- Open the file and follow the brief install wizard
- It would be best to restart your computer, but if you want to test that the install succeeded, open the Terminal app and run this command:
git --version
Windows
In a similar fashion to the Mac installation above, there is an executable Windows installer available on the Git downloads page.
- Download the Git for Windows executable installer file
- Click Next to continue through the setup wizard
- The Use Git from the Windows Command Prompt option is considered safe to use because it adds minimal extras to your command line
- Click Next through the next series of options
- Click the Finish button to complete the installation
You now have Git installed on your Windows computer, and you can run the version command used above for the Mac OS installation to test your configuration.
How to Install Git on Your InMotion Hosting Server
These steps will be similar for your VPS/Dedicated server and your Choose your own stack server and your local Linux operating system.
The easiest way to get Git up and running on your computer is to open up your favorite Terminal app or command line utility and run an installation command.
For the most popular enterprise Linux distributions such as CentOS, the following command will provide you with the most recent stable version of Git.
sudo dnf install git-all
For Debian/Ubuntu operating systems, you can run this command:
sudo apt-get install git
For Fedora operating systems, you can use:
sudo yum install git
It is best advised to check your operating system and current version and use commands listed in the Git documentation.
In the next article, we’ll learn about how to initiate your repository.