---
description: Instructions for both Windows and Mac OS git installations
---

# Git and Gitbash Installation

## Overview <a href="#overview" id="overview"></a>

In this section we will install git for both windows and mac as well as **gitbash** for windows. We did not have to install git before on C9 because it was included with the linux ubuntu version we were using. So lets git started by going to your OS install instructions below.‌

* ​[Mac Users Install](https://app.gitbook.com/@softstack-factory/s/ionic/environment-set-up/git-and-gitbash#git-for-mac)​
* ​[Windows Users Install](https://app.gitbook.com/@softstack-factory/s/ionic/environment-set-up/git-and-gitbash#git-and-git-bash-for-windows)​
* ​[Git User Config - All Users](https://app.gitbook.com/@softstack-factory/s/ionic/environment-set-up/git-and-gitbash#git-user-config) ​

‌

## Git for Mac <a href="#git-for-mac" id="git-for-mac"></a>

{% hint style="warning" %}
**Mac Users Only!**
{% endhint %}

### Overview <a href="#overview-1" id="overview-1"></a>

There are several ways to install Git on a Mac. The easiest is probably to install the Xcode Command Line Tools. On Mavericks (10.9) or above you can do this simply by trying to run _**git**_ from the Terminal the very first time.‌

### Installation <a href="#installation" id="installation"></a>

Open a terminal on your machine and run the following command.

```
$ git --version
```

‌

If you don’t have it installed already, it will prompt you to install it.![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LJGCNbzU5AzY8ny5seD%2F-L_FLWS1s4-tTXDhVe9t%2F-L_FNMpalIDOOSXpZa2M%2Finstalling-mavericks-popup.png?alt=media\&token=5cb58176-1110-4430-88e1-b1167dafeda0)Git XCODE Install Prompt‌

If you want a more up to date version, you can also install it via a binary installer. A macOS Git installer is maintained and available for download at the Git website, at [http://git-scm.com/download/mac](http://git-scm.com/download/mac).‌

### Confirm Install <a href="#confirm-install" id="confirm-install"></a>

Lets check the install by starting **Git,** run the following command in our terminal:

```
$ git
```

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LJGCNbzU5AzY8ny5seD%2F-L_FLWS1s4-tTXDhVe9t%2F-L_FOBOLy0LWQ9KqNKtT%2Fgit_cli.png?alt=media\&token=a7c6534b-332c-4756-a0af-5dfafc053c30)Git Succesful Install

Success if you have the same output as the above image. [**Continue to Git User Config**](https://app.gitbook.com/@softstack-factory/s/ionic/environment-set-up/git-and-gitbash#git-user-config)**​**‌

## Git and Git Bash for Windows <a href="#git-and-git-bash-for-windows" id="git-and-git-bash-for-windows"></a>

{% hint style="warning" %}
WINDOWS ONLY!
{% endhint %}

### Overview <a href="#overview-2" id="overview-2"></a>

For windows we have to install not only **git**, but **git bash** as well. In C9 we were using a bash shell to write all our commands in the terminal. Windows uses a different shell by default, PowerShell. If do not install git bash all the commands you are used to using in the terminal will not work. For example, ls and cd command would be something different.‌

### Windows - Active Developer Mode <a href="#windows-active-developer-mode" id="windows-active-developer-mode"></a>

First, verify that you've got the most recent release of Windows and update if not.‌

Now, we need to **activate developer** mode in **Settings**. Open Settings (by typing "settings" in Cortana at the bottom left of your screen) and choose **"Update & Security"** then **"For developers"**, and then turn on **"Developer mode"** if it's not already selected.![](https://lh3.googleusercontent.com/xah0P2FlQyRvydp7fhXiGBHKHlObYV0RVCauU63iCAfESUVXIm_wIHVfZQ7B_5Ra8CFw48Jw0yrT8lI4CORYR3rdpzsCHN--oDN-cdK_vVxojjkx4yyWZdmgW7-nBZQvK9SAzNsg)Updating Windows Settings

You may be prompted to install additional packages (and you should do this if prompted) and a restart may be required (which you should also do).‌

## Install Git <a href="#install-git" id="install-git"></a>

Now we need to install Git for Windows. Download and run the installer, which you'll find a link to [here](https://git-for-windows.github.io/). The installer will prompt you through several setup screens. You should select the default option for each one, with the exception of the "Select components" screen, where you may opt to add a Git Bash icon to your desktop.![](https://lh4.googleusercontent.com/qC6rTffUPSNojD3PIdllFtYWtVrszZbeYy1Pjp_OirusGfNuPpbgiH8-hgsmab6mFEtx_ta0d2rIoANgTrztx0BFT9Ax2Q0a6s4Ax6ibj1oUwUy0wQvd-4y8HfP4ysdfwzxaZOnG)Git Bash Installer‌

Once the installation has finished, you can open Git for Bash by clicking on Cortana and typing "Git Bash").

Congrats! You've now got a Linux-like command line environment running in Windows. [**Continue to Git User Config**](https://app.gitbook.com/@softstack-factory/s/ionic/environment-set-up/git-and-gitbash#git-user-config)**​**‌

## Git User Config <a href="#git-user-config" id="git-user-config"></a>

In this section we will be configuring **Git** so it will use the right account information.

GIT must be installed for this section.‌

#### Set your Commit email and username (Global Scope) <a href="#set-your-commit-email-and-username-global-scope" id="set-your-commit-email-and-username-global-scope"></a>

We are letting **Git** know what our default **email** and **usernames** are for every commits on any project... You can also do this on a project by project basis, but we will instead choose to set our default values _**globally**_ by running the following commands in your terminal‌

{% hint style="warning" %}
**NOTE:** the angle braces, **<>** above denote a placeholder they are not apart of the command. It is common convention in technical documentation to use angle braces, **<>** as placeholders for your specific information.‌
{% endhint %}

**EMAIL:**

```
$ git config --global user.email <email@example.com>
```

#### USERNAME: <a href="#username" id="username"></a>

```
$ git config --global user.name <Mona Lisa>
```



#### Check Our Config Settings <a href="#check-our-config-settings" id="check-our-config-settings"></a>

The following commands should printout your **username** and **email** you entered in the previous step. If they do not repeat the step above.‌

**Email:**

```
$ git config --global user.email
```

&#x20;**Username:**

```
$ git config --global user.name
```

Success! Your Git Account is now setup.‌

## Recap <a href="#recap" id="recap"></a>

You installed Git and if you were a windows users Bash as well, since windows does not come with it. After that you setup Git to use your existing user information.
