Download Git Command Line Mac

The other is to install Xcode, which includes the Command Line Developer Tools. A third option is to click Cancel and get the latest version of Git direct from the developers. Click on Mac OS. Install Git on Mac. There are multiple ways to install Git on mac. It comes inbuilt with Xcode or its other command-line tools. To start the Git, open terminal and enter the below command. May 20, 2013. Install Git on Mac OS X There are several ways to install Git on a Mac. In fact, if you've installed XCode (or it's Command Line Tools), Git may already be installed. To find out, open a terminal and enter git -version. $ git -version git version 2.7.0 (Apple Git-66). Installing and configuring Git on macOS can seem difficult if you’ve never used a command line before, but there are only a few things to learn to get started. This guide will take you through the steps to install and configure Git and connect it to remote repositories to clone, push, and pull.

At its core, Git is a set of command line utility programs that are designed to execute on a Unix style command-line environment. Modern operating systems like Linux and macOS both include built-in Unix command line terminals. This makes Linux and macOS complementary operating systems when working with Git. Microsoft Windows instead uses Windows command prompt, a non-Unix terminal environment.

In Windows environments, Git is often packaged as part of higher level GUI applications. GUIs for Git may attempt to abstract and hide the underlying version control system primitives. This can be a great aid for Git beginners to rapidly contribute to a project. Once a project's collaboration requirements grow with other team members, it is critical to be aware of how the actual raw Git methods work. This is when it can be beneficial to drop a GUI version for the command line tools. Git Bash is offered to provide a terminal Git experience.

Install git command line

What is Git Bash?

Git Bash is an application for Microsoft Windows environments which provides an emulation layer for a Git command line experience. Bash is an acronym for Bourne Again Shell. A shell is a terminal application used to interface with an operating system through written commands. Bash is a popular default shell on Linux and macOS. Git Bash is a package that installs Bash, some common bash utilities, and Git on a Windows operating system.

How to install Git Bash

Git Bash comes included as part of the Git For Windows package. Download and install Git For Windows like other Windows applications. Once downloaded find the included .exe file and open to execute Git Bash.

Download Git Command Line Mac

How to use Git Bash

Git Bash has the same operations as a standard Bash experience. It will be helpful to review basic Bash usage. Advanced usage of Bash is outside the scope of this Git focused document.

How to navigate folders

The Bash command pwd is used to print the 'present working directory'. pwd is equivalent to executing cd on a DOS(Windows console host) terminal. This is the folder or path that the current Bash session resides in.

The Bash command ls is used to 'list' contents of the current working directory. ls is equivalent to DIR on a Windows console host terminal.

Both Bash and Windows console host have a cd command. cd is an acronym for 'Change Directory'. cd is invoked with an appended directory name. Executing cd will change the terminal sessions current working directory to the passed directory argument.

Git Bash Commands

Git Bash is packaged with additional commands that can be found in the /usr/bin directory of the Git Bash emulation. Git Bash can actually provide a fairly robust shell experience on Windows. Git Bash comes packaged with the following shell commands which are outside the scope of this document: Ssh, scp, cat, find.

In addition the previously discussed set of Bash commands, Git Bash includes the full set of Git core commands discussed through out this site. Learn more at the corresponding documentation pages for git clone, git commit, git checkout, git push, and more.

Next up:

How to store dotfiles

Start next tutorial

For The TL;DR version, you can download Git For OS X in its Google Code Repository.

When sharing my WordPress Developer Toolbox, I mentioned that GitBox is my Git client of choice. As with most software that offers a command line variant, I occasionally end up using a Terminal session to manage some of my Git repositories.

Depending on what other applications you have installed on your system, you may not actually have command line access to Git. If that’s the case and you’d rather not install the full Xcode development suite (because it does include the command line utility), there is an alternative.

Install Git on Mac OS X

1. Download Git OS X Installer

The Git OS X Installer is an open source project hosted on Google Code that makes it incredibly easy to install Git without interfering with any of your front end applications and without needing to install larger development tools.

All of the versions are accessible via the downloads page and all mention Snow Leopard, but are compatible with all Intel processors. Note that the latest version is at the top of the list.

The most recent version at the time of this post is 1.8.0 and fully works with Mountain Lion.

Git Command Line Download Windows

2. Install Git on Mac OS X

The Git OS X Installer is a typical OS X setup program, so simply walk through the steps that the installer provides.

Note that since the files are being installed in /usr/local you will need root access – that is, you’ll need to enter the administrator’s password during the setup procedure.

Once setup is completed, you should be good to go.

3. Test The Installation

Once the installation is complete, you’ll need to close all active Terminal sessions. Open a new session and issue the git command. Permitting all is well, you should see a screen similar to what’s above.

Install Git Command Line

And that’s it. Easy enough, right?

Git Command Line Extension

Now you can continue to use whatever front end application you like while also being able to issue commands from the command line.