Resources‎ > ‎

Checking Out Items from GitHub

If you would like to work on a CocoaNuts project but lost your files, or you have errors in your project you don't know how to fix, you can start off fresh by checking out CocoaNuts projects from GitHub. 

Here is a brief overview of the terminal commands you may want to use: 
  • cd <directory> This command allows you to "change directory" just like you would by clicking on a folder in Finder. 
  • ls This command allows you to see the contents of the current folder. 
  • pwd This command allows you to see where you're currently located in the file system. It stands for "Print Working Directory" 
  • mkdir This command stands for "make directory" and allows you to create a folder. 

First, check to make sure git is working on your system. Open the Terminal application and type which git . You should see a response that looks something like this: /usr/bin/git If you don't, you may have an issue with your Xcode Command Line Tools installation, and you should ask for help. 

Next, navigate to the git repository you want to check out in a browser. For example, let's say I want to check out the CocoaNuts project Tell A Story.  Use terminal to navigate to the folder you want to put the sample project into. It should be a different folder than your working copy of the application. For example, if my Tell A Story project is located in /Users/brichapman/Developer, I should choose a different location for the sample project. 

Copy the link to the git repository located here: 

Use terminal to check out the repository by typing git clone https://github.com/iluvcompsci/TellAStory.git where the URL is the one you copied from the git repository. You should see a response like this: 

Cloning into 'TellAStory'...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
Checking connectivity... done.

Congratulations! Now if you navigate to that directory in Finder, you will see the project there. 

Comments