BASIC Step 3: Using git for worksheets 11+
If you have finished with the first worksheets series of BASIC, you may want to continue on with "advanced" BASIC. In this part of BASIC, you will learn how to use Git tools.
Why do we need special Git tools to get access to BASIC materials? Github is a way of sharing your code with other people. There is a "master" version hosted by Git, as well as your own local version ("head"), located on your computer. This way, you can make some changes to code without everybody immediately being affected; the changes that you make on your local machine have to be "pushed" into the master in order for it to be accessible to others. All of our lab code is stored in Git repositories, which means that we can easily share between computers without wrecking everything for everybody whenever we are trying to make an update.
BASIC has a separate repository from the main lab repositories, called "comppedagogy". This means that you can get your git legs under you in a sandbox where nothing "important" can be affected before working on code in the main lab repositories. If you've completed main BASIC already, you've already seen this repository when working on Worksheet A. Now you will have access to edit this code, in addition to viewing it.
To access these materials, follow these instructions:
Make a Github account
Make a GitHub account at https://github.com/ if you don't already have one. Once you have this account made, send Robin a Slack message so that you can get write permission to the repository. (If Robin's out, message the lab manager as a back-up.)
Install Git tools
To access the Git repository, you must install some Git tools on your personal computer.
If you are using a Mac, you can work straight from Terminal but you will have to install some tools the first time you try to use git: (If you have never used Terminal before, this is how to access it, click here)
- Open a new terminal window and type
cd ~/Documents
then press Enter - Type
git clone https://github.com/blab-lab/comppedagogy
and press Enter - You will be prompted to install git tools, and possibly XCode tools. Follow the prompts to install these.
- If you are running Catalina, you might get an error that you're "unable to install xcode command line developer tools." Install XCode from the App Store, then try installing git tools again.(source: https://developer.apple.com/forums/thread/660641)
If you are using a Windows PC, you need to install Git Bash: https://git-scm.com/
Clone the comppedagogy repo to your computer
If you are on a Mac
1. Open Terminal and type cd ~/Documents
and hit enter. This should move you into your "Documents" folder.
If you are on a PC
1. Open Git Bash and type cd C:/Users/yourusername/Documents
and hit enter. "yourusername" should be whatever your profile is on your computer---for example, mine is "RobinK" so I would type cd C:/Users/RobinK/Documents
(If you still remember command line syntax from early BASIC, you can navigate to your documents folder however you like, but this should be a fairly foolproof way of doing it if you have forgotten! However, if you have forgotten, you should go back and refresh.)
No matter what computer you are on:
2. Type git clone https://github.com/blab-lab/comppedagogy
and hit enter. You should get a bunch of feedback from Terminal/Git Bash telling you about all the things it is copying in.
3. Now type ls
and hit enter to get a list of all the things that are in your "Documents" folder. You should now have a folder called "comppedagogy" in there. To access the advanced BASIC worksheets, look in the folder called "worksheets2". Start with Worksheets C-D, then move onto Worksheets 11-15. Worksheets 11-15 are also in the online Matlab drive.