Git Installation



Install Git on Windows

Git for Windows stand-alone installer

  1. Download the latest Git Windows the stand-alone installer from the following page https://git-scm.com/downloads

  2. When you started the git installer, you will see the Git Setup wizard screen. Choose the Next and Finish prompts to complete the installation. Default options are suitable for most users.

  3. Open Git Bash or Windows Command Prompt. (if during the installation you choose not to use Git from the Windows Command Prompt, you should use Git Bash)

  4. To check that the installation of Git complete with success, type the following command

    $ git version
    git version 2.29.2
    

    On the output, you will see the corresponding version of your installed Git.

  5. Configure your Git username and email by running the following commands. This information will be associated with any commits that you add.

    $ git config --global user.name "expectocode"
    $ git config --global user.email "user@expectocode.com"
    

Install Git on Linux

Debian/Ubuntu (apt-get)

  1. From your terminal, start the general OS and package update.

    $ sudo apt-get update
    
  2. To install Git, run the following command:

    $ sudo apt-get install git
    

    the command below will install Git on your system, but it may ask you for some confirmations.

  3. Check if the installation was successful by typing:

    $ git --version
    git version 2.29.2
    

    On the output, the version will correspond to the version of Git you installed.

  4. Configure your Git username and email using the following commands:

    $ git config --global user.name "your name" 
    $ git config --global user.email "yourmail@expectocode.com"
    

Install Git on Mac OS

There are different ways to install Git on Mac. It comes included with Xcode or its other command-line tools. Git may be already installed. To find out, type this command on the terminal:

$ git --version 
git version 2.27.0 (Apple GIT-66)

Apple supports Git, but it tends to lag behind mainstream Git by serval major versions.

Git for Mac Installer

The simplest method to install Git on Mac is by using the stand-alone installer.

  1. Download the last version of Git by visiting the official page https://git-scm.com/downloads.

  2. Follow the prompts to install Git.

  3. To verify the installation was successful, type the following command:

    $ git --version 
    git version 2.29.2
    
  4. Configure your Git username and email using the following commands:

    $ git config --global user.name "expectocode" 
    $ git config --global user.email "user@expectocode.com"
    

Install Git with Homebrew

If you are using Homebrew to manage package on OS X, you can follow the steps below:

  1. From your terminal, install Git using Homebrew:

    $ brew install git 
    
  2. Verify if the installation was successful by typing the following command:

    $ git --version 
    git version 2.29.2 
    
  3. Configure your Git username and email using the following commands:

    $ git config --global user.name "expectocode"
    $ git config --global user.email "user@expectocode.com"
    

Install Git with MacPorts

If you are using MacPorts to manage package on OS X, you can follow the steps below:

  1. From your terminal, update MacPorts:

    $ sudo port selfupdate 
    
  2. Search the latest available Git ports and variants:

    $ port search git 
    $ port variants git 
    
  3. Install Git and some extra tools that will help Git in different manners.

    $ sudo port install git
    


ExpectoCode is optimized for learning. Tutorials and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy.
Copyright 2020-2021 by ExpectoCode. All Rights Reserved.