Skip to main content Link Search Menu Expand Document (external link)

Git and GitHub

Make sure that you sign up for a GitHub account and activate your benefits for students.

You’ll be writing Markdown files for lab writeups. GitHub has provided a nice cheat sheet for formatting a document using Markdown.

git resources

  • This series of videos does a good job of providing an overview of version control and git.
  • The git book (especially chapters 1–3) provide a nice overview of git.
  • GitHub has a guide for git beginners.
  • GitHub also has videos on YouTube, including this playlist that covers some basics.

Setting up git

When you log in to lily, you should configure git with your identity:

$ git config --global user.name "Marion Lang"
$ git config --global user.email "langm@rhodes.edu"

As of late 2021, GitHub disabled using your password for accessing repositories and instead recommends using tokens when using HTTPS or ssh keys when using ssh. We will use ssh.

  • To set this up, follow the general directions here and here.

  • Speficially, for our environment:

    1. Log into lily.
    2. Use the email you used to sign up for GitHub in the following:

      $ ssh-keygen -t ed25519 -C "your_email@example.com"
      
    3. When it prompts you for file name, just hit enter.
    4. When it prompts for a passphrase, hit enter for none.
    5. $ exec ssh-agent bash
    6. $ ssh-add ~/.ssh/id_ed25519
    7. $ cat ~/.ssh/id_ed25519.pub
    8. Copy the output of the last command.
    9. Go to github.com/settings/keys.
    10. Click “New SSH key.”
    11. Give it a name (e.g., “lily”).
    12. Paste the output from the cat command into the “key” box.
    13. Click “Add SSH key.”

Previewing markdown

To preview a markdown file on lily (which does not have a GUI), you can do $ mdview.sh markdown-file.md. This is just a tiny shell script that runs $ pandoc markdown-file.md | lynx -stdin.