6.005 — Software Construction
**This document is a work in progress.** Use Piazza to suggest further Git tips and tricks we might include.
## Getting started On UNIX-like operating systems (OS X or Linux distros) the following commands on the command line (such as `cd`, `pwd`, and `ls`) are all native. You can simply load up your terminal application and try them out. Note that if you're using Cygwin, then your Windows machine is basically UNIX-like. However, on Windows machines without Cygwin we recommend you install Git for Windows from [the Git site](http://git-scm.com/downloads). If you run the program Git Bash you'll be able to follow along with the commands we mention (e.g. `cd`, `ls`, `pwd`). ## The command-line One of the things 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, especially because it's hard to understand what's specific to Git and what's not. A command-line is just an interface to your computer, totally analogous to 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 one or more arguments, all 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. Here are some common ones: * `cd directory-name` (stands for "change directory") --- Switches to the directory `directory-name`. * `pwd` (Stands for "print working directory") --- Prints out the current directory. * `ls` --- Lists the files in the current directory ### Arguments Most commands you type in are actually other programs. When those programs get launched, the command-line passes in the arguments to the program so that it can do something with them. In Java, this is what gets stored in the `String[] args` argument passed to the `main()` method of your program. ## Git Git is also just another program, so when you type in something like `git subcommand whatever...`, the `subcommand whatever` part gets sent to Git, the program. Git, in turn, just manipulates a directory in your repository called `.git` (you can't normally see it when you run `ls` because it's "hidden"; if you say `ls -a` at the top level of your repository, it will appear).