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:
- Log into lily.
-
Use the email you used to sign up for GitHub in the following:
$ ssh-keygen -t ed25519 -C "your_email@example.com"
- When it prompts you for file name, just hit enter.
- When it prompts for a passphrase, hit enter for none.
$ exec ssh-agent bash
$ ssh-add ~/.ssh/id_ed25519
$ cat ~/.ssh/id_ed25519.pub
- Copy the output of the last command.
- Go to github.com/settings/keys.
- Click “New SSH key.”
- Give it a name (e.g., “lily”).
- Paste the output from the
cat
command into the “key” box. - 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
.