Skip to main content

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.
  1. Cloning the mathbook repository
    In your Git Bash shell, first enter the command cd (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 called mathbook 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.
  2. Keeping the mathbook repository on your local machine up to date
    Whenever the developers make changes to the files in the GitHub repository mathbook, you can update these files accordingly on your local machine by navigating in the Git Bash shell to the mathbook folder and entering the command git 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 you git pull to update your mathbook folder, you should be in the dev, not master, branch.If your Git Bash prompt ends in mathbook (dev), you’re in the correct branch. If it ends in mathbook (master), enter in git checkout dev to move to the correct dev branch before entering git pull.