Note that this site is in currently in version 1.0.0-alpha.   Some functionality may be limited.

3. Review of the Command Line

During this workshop, you’ll be communicating with GitHub from your local computer via the command line (the Terminal or the Git Bash on Windows). This section reviews some of the basic commands that will also be used in this workshop. In addition to the command line, you’ll be using your text editor and your browser. Before continuing, its important that we clearly distinguish between these three different spaces or environments:

  • Your plain text editor where you’ll be writing your syllabus is on your local computer.
  • That syllabus is initiailly saved in a git-enabled repository on your local computer.
  • Your browser is where you’ll be uploading your repository to GitHub, a cloud service.
  • Your terminal is where you’ll be communicating with GitHub to send the repository and project files back and forth between the cloud (which you can view through the GitHub website) and your hard drive. Because you’ll be moving between these three spaces throughout the workshop, you may want to use (command (⌘) + tab) or (control + tab) to move quickly between the three windows on your desktop.

Accessing the Terminal

macOS

Hold the command (⌘) key and press the space bar at the same time to bring up the “Spotlight Search” window. Type terminal, followed by enter to quickly open the Terminal.

Windows

Press the windows button on your keyboard. When the search menu pops up, type git bash and press enter.

Practice Navigating the Command Line

If you don’t feel comfortable navigating your hard drive through the command line, here is a short section catching you up. If you feel fairly comfortable using the command line, you can skip this section, and go straight to the next one.

You can create the folder anywhere on your hard drive by typing the following into your terminal and hitting enter.

$ cd <directory-name>

Let’s practice this command by using it to take us to our Desktop. Type the following command into your terminal and hit enter.

$ cd Desktop

This will change your current working directory from /Users/<your-name> to /Users/<your-name>/Desktop.

Check your current directory by typing the following command into your terminal and hit enter:

$ pwd

Now, use the following command to go up one directory:

$ cd ..

Check your current directory again using the following command. You should be back in your “home” directory:

$ pwd

Practice going back and forth between your Desktop and your home directory.

When finished, go to your Desktop folder and check that you’re there with pwd.

Making a Projects Folder

In this session, we will be making a syllabus and using Git to keep track of our revisions. Let’s create a Git project folder.

If you’ve worked through the command line session, you should already have a projects folder on your desktop. If you don’t have a projects folder on your desktop, create one using the following command:

$ mkdir projects

From Desktop, Navigate into your projects folder using the following command:

$ cd projects

Then create a git-practice folder with the following command:

$ mkdir git-practice

Navigate into the new git-practice folder using the following command:

$ cd git-practice

At this point, when you type pwd, your folder structure should look like this:

$ pwd
/home/<username>/Desktop/projects/git-practice

Challenges for lesson 3

Questions

Try again!

Which best describes where you are working when you're writing in your plain text editor:

(Select one of the following)

Try again!

Which best describes where you are working when you're using your terminal to communicate with GitHub and share the files:

(Select one of the following)

Try again!

Which best describes where your files are when you are viewing them in GitHub:

(Select one of the following)

Try again!

Git-enabled repository means

(Select one of the following)

Try again!

Which command do you use to make a new folder?

(Select one of the following)

Try again!

Which command do you use to enter into a folder?

(Select one of the following)

Try again!

Which command do you use to check where you are?

(Select one of the following)

Workshop overall progress