Chapter 3 Cloning and maintaining the mathbook
repo
Don’t know what this means? That’s ok! A GitHub repository (or “repo”) is basically a collection of files hosted on GitHub, and what you need to know for now is that you’re essentially copying onto your local computer a GitHub repo in a way that will allow you to later easily update the files on your local machine in accordance with their updates in the corresponding GitHub repo. Some of these files you don’t “need” (e.g., the library of examples), but some you do (e.g., the files
mathbook-html.xsl
and mathbook-latex.xsl
), and you will need to update these from GitHub from time to time, so you should follow these instructions exactly.-
Cloning the
mathbook
repositoryIn your Git Bash shell, first enter the commandcd
(this will take you to your default directory).Next, enter in the following commands, pressing enter after each command:git clone https://github.com/rbeezer/mathbook.git cd mathbook git checkout dev
This will install a folder calledmathbook
in your on your local machine that contains the necessary (and optional) files. Do not move this folder or its contents. If you install this folder somewhere else, or move it, you will need to make adjustments to later commands described in this tutorial. -
Keeping the
mathbook
repository on your local machine up to dateWhenever the developers make changes to the files in the GitHub repositorymathbook
, you can update these files accordingly on your local machine by navigating in the Git Bash shell to themathbook
folder and entering the commandgit pull
.You should pull from this repo daily, or at least whenever you plan to compile, since it is very regularly updated.Important note: When yougit pull
to update yourmathbook
folder, you should be in thedev
, notmaster
, branch.If your Git Bash prompt ends inmathbook (dev)
, you’re in the correct branch. If it ends inmathbook (master)
, enter ingit checkout dev
to move to the correctdev
branch before enteringgit pull
.