Tutorials/Tips

How to install and configure Git on your favorite Linux distribution

Git is a distributed version control system that anybody engaged in any serious coding task ought to be using. Thankfully, that’s what most coders are using, so if you are new to this, here’s how to install it on your favorite Linux distribution.

Install Git on Debian/Ubuntu distributions

To install Git on Debian, Ubuntu and distributions that are derived from them, that is, those that use Debian’s Advanced Packing Tool (APT), open a terminal emulator and type the following command:

Install Git on Fedora/CentOS distributions

To install Git on CentOS, Fedora and distributions that are derived from them, that is, those that use DNF or Yum for package management, open a terminal emulator and type one of the following command:

Install Git on Arch Linux distributions

To install Git on distributions like Antergos and Manjaro that are based on Arch Linux, that is, those that use pacman for package management, open a terminal emulator and type the following command:

Related Post:  Troubleshooting disk usage on a Linux server with ncdu

Configure global Git settings on Linux

Your first step towards using Git is to at least configure your username and email address, since you’ll need those to be able to push your code to a hosted Git platform like Bitbucket, GitHub and GitLab. You can configure those globally, but you can also configure them per project, or locally. The global settings are stored in the .gitconfig file under your home directory, while the local, or per-project settings are in the project’s .git/config file.

The two commands you’ll need to configure a global username and email are:

Related Post:  How to enable two-factor authentication on Dropbox

Configure local Git settings on Linux

Your local, or project-specific settings are stored in a project’s .git/config file. Use the following commands to set the username and email address you’ll like to use for a specific project.

With Git installed and with that minimal configuration, you can start using it to push code to a Git server. Happy coding!

Git logo

Subscribe to LinuxBSDos.com

Subscribe to receive the latest articles in your Inbox

Trust me, you'll not be spammed...

Please share:

We Recommend These Vendors and Free Offers

Google has got competition, because Presearch is building a blockchain-based search engine controlled by the community. At $0.15 a token, you can participation in Lot 3 of the token sale by clicking here

Open Money is building a solution that will run mainstream software on blockchain tech. Click here to get free tokens that will be the digital currency of the platform

COMSA allows centralized businesses to adopt blockchain technology. The token sale starts soon! Sign up for free by clicking here

Register now for Blockchain & Cryptocurrency Con 2018, international conference on blockchain technnology in Dallas, TX (USA), Feb. 23-24, 2018. Students can register at a 50% discount.

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).


Leave a Comment

Your email address will not be published. Required fields are marked *

*