Git logo

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 using apt

sudo apt install git

#

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 using DNF

sudo dnf install git

# If your distribution is still using Yum, install Git using

sudo yum install git

#

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:

# Install Git using pacman

sudo pacman -S git

#

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.

Related Post:  How to set up a 3-node CoreOS cluster, just for fun

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

# Configure a global username
# Replace USERNAME with your own username

git config --global user.name USERNAME

# Configure a global email address
# Replace EMAIL-ADDRESS with a valid email address

git config --global user.email EMAIL-ADDRESS

#

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.

# Configure a local username
# Replace USERNAME with your own username

git config --local user.name USERNAME

# Configure a local email address
# Replace EMAIL-ADDRESS with a valid email address

git config --local user.email EMAIL-ADDRESS

#

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

Related Post:  Manual disk partitioning guide for Deepin 2014

Git logo

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Hola! Did you notice that LinuxBSDos.com no longer runs network ads?  Yep, no more ads from the usual suspects that track you across the Internet.  But since  I still need to pay to keep the site running, feel free to make a small donation by PayPal.

Subscribe for updates. Trust me, no spam!

Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

Leave a Reply

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

Get the latest

On social media
Via my newsletter
Mailchimp Signup Form

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.

Categories
Archives

The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.

Anastasia Marchenkova

An invitation from Anastasia Marchenkova

Hya, after stints as a quantum researcher at Georgia Tech Quantum Optics & Quantum Telecom Lab, and the University of Maryland Joint Quantum Institute, I’m now working on superconducting qubit quantum processors at Bleximo. I’ll be speaking during Algorithm Conference in Austin, Texas, July 16 – 18, 2020. Meet me there and let’s chat about progress and hype in quantum computing.