A GitHub vs Moodle showdown
Vicky Scowcroft
Department of Physics, University of Bath
github.com is an online hosting service for software development and version control
Can collaborate without file editing clashes.
Pick and choose which changes to keep.
GitHub pages | Moodle |
---|---|
Externally visible | Visibility limited by course access |
Initial set-up can be faffy | Initial set up done centrally |
Built-in version control | Updates remove previous version1 |
Easy2 to make incremental changes | Changes require re-uploading everything |
Assuming you already have an account on GitHub (or Bath GitHub) and you’ve set up your credentials:
Step | Command |
---|---|
1st time only: Create repository | git init |
To get the most up to date remote version: Pull the remote repository to your computer | git pull |
Create/edit content | |
Add files you want to commit | All files with changes: Individual files: |
Check what’s going to change | git status |
Commit your files to be uploaded and say what your changes are | git commit -m "your message here" |
Push files to GitHub | git push |
gh-pages
branchSet up gh-pages
branch
Clone this branch into a new folder:
git clone -b gh-pages $repo-path book-output
$repo-path
is the location of the repository on github, e.g. https://github.com/your_user_name/lecture_notes.git
cd book-output
cp -r ../_book/* ./
git add --all *
git commit -m "Update the book" || true
git push -q origin gh-pages
assuming your bookdown book is in a folder called _book
docs
folderSet up GitHub pages to generate automatically from the docs
folder
_book
folder to docs
git add
, commit
, and push
the main repository as normal._book
file to _book.zip
index.html
as the main fileShould now see a link to your document on Moodle.
PH40112 Relativistic Cosmology 2021/22: This is not externally accessible. . . .
What’s annoying about this?
Bookdown Away Day, 6th September 2022
Why is this useful for lecture notes??