Using the command line

 

One thing that makes learning Git hard for many students is that it’s a command-line program. If you’re not familiar with the command-line, this can be confusing.

 

A command-line is just an interface to your computer, totally analogous to the Finder or Windows Explorer, except that it’s text-based. As the name implies, you interact with it through “commands” — each line of input begins with a command and might have zero or more arguments, separated by spaces. The command-line keeps track of what directory (folder) you’re in, which is important to many of the commands you might be running.

 

Common commands

 

On UNIX-like operating systems (OS X or Linux) open the Terminal application to use these commands.

 

On Windows you should install Git for Windows from the Git site. Then run the program Git Bash to open a terminal where you can run all these commands, in addition to Git commands.

 

Here are some of the most common commands:

 

 

This document is based on the 6.005 Getting Started Notes.