Using Git and GitHub to Download Our Libraries and Code Examples

Git and GitHub

Git is a piece of software used for keeping track of changes to code over time. Git stores code for projects or libraries in units called repositories. GitHub is a popular service for storing and distributing Git repositories. There are also other services that can be used to store Git repositories such as GitLab and BitBucket. BasicMicro has a range of sample code and libraries hosted on GitHub so that users can easily get a hold of them. This Application Note cover two methods of obtaining code from BasicMicro’s repositories.

BasicMicro GitHub Repositories

All of BasicMicro’s example code and libraries can be found on GitHub here: GitHub link.

Downloading .zip File

The first method for pulling code from GitHub is downloading a zip file of the repository. No tools, other than a web browser, are needed for this method.
1. Using a web browser, navigate to the desired repository. Use this link as a starting point to find BasicMicro’s repositories.
2. Locate the button labeled “Clone or download”.

Figure 1: The dialog used to download a zipped version of the repository.

3. In the dialog that opens click on “Download ZIP”.
4. Move the downloaded zip file to a useful location and unzip the file to use the code.

Command Line

The second method for pulling code from GitHub is to use the Git client software. The Git client will need to be installed on the computer in use.
1. Install the Git client on the machine being used. There are versions available for Windows, Mac OS X and Linux. The downloaded for each OS can be found here.
2. Using a web browser, navigate to the desired repository. Use this link as a starting point to find BasicMicro’s repositories.
2. Locate the button labeled “Clone or download”. Click on the button and note the address of the repository.

Figure 2: The address of the repository in the opened dialog.

3. Open a terminal window on the computer and navigate to where the cloned repository should be stored.
4. Type “git clone” followed by the address of the repository from the dialog. Press enter and the repository will be cloned in to the current directory. For example:
git clone https://github.com/basicmicro/roboclaw_python_library.git

5. Enter the directory created by the cloning process to view and use the code in the repository.