Goals
Learning about version control systems and how they help in the development of DH project, which are often a lengthy and complex, and require organic collaboration.
Software & Other Required Materials
- Make sure to create a github account (https://github.com/), if you do not have one.
- Download and install
git
software:- for Windows:
- you can download it from https://git-scm.com/download/win. Please, choose 64-bit Git for Windows Setup.
- you can also install a portable version of
git
from https://git-scm.com/download/win. Please, chose 64-bit Git for Windows Portable. Simply download and unzip (Suggestion: move that unzipped folder to the folder where you keep all class-related files and materials).
- for Mac: try to run
git --version
from Terminal. Ifgit
is not installed, you will be prompted to installXcode Command Line Tools
which comes withgit
among other things. This is the easiest way.
- for Windows:
In Class
- Basic
git
functionality; - Starting a
github
-based website; - Basics of
markdown
;
General git
workflow:
- In
Terminal
(on Mac) orGit-Bash
(on Windows)fork
a repositoryclone
- work
add
commit
push
/pull
- send
pull request
Main git
Commands
git clone <link>
- clones/downloads a repository on you machine
git status
- shows the current status of the repository (new, changed, deleted)
git add .
- adds all new files and modified files to the repository
git commit -m "message"
- saves all files in their current state into the repository, and created a milestone
git push origin master
- uploads changes to github.com
- NB: sometimes you may get an error, which in most cases means that you need to
pull
first
git pull origin master
- downloads changes from github.com
git log
- shows the history of
commit
s; here you can choose where you want to roll back, in case of troubles
- shows the history of
Some useful command line commands
pwd
- shows you where you are on a drive (gives you path)
ls
/dir
[on Windows]- shows everything in the your current location/folder
cd <name of the folder>
- takes you to that folder
cd ..
- takes you one level up in the tree structure of your computer
Reference Materials
- Simpkin, Sarah. 2015. “Getting Started with Markdown.” Programming Historian, November. https://programminghistorian.org/.
- Visconti, Amanda. 2016. “Building a Static Website with Jekyll and GitHub Pages.” Programming Historian, April. https://programminghistorian.org/.
Homework
- Build your website on
. - You can use this template https://github.com/daattali/beautiful-jekyll (the page also includes step-by-step instructions; our course website is built with this theme).
- You are encouraged to use other themes as well. Check, for example, https://jekyllthemes.io/ or http://jekyllthemes.org/. Or, ask Google.
- Brief instructions (more details can be found in Visconti’s tutorial (see above), and on the page of the suggested template)
fork
- create a repository under your account with the name:
username.github.io
, where username is your github username; the repository with such names are automatically treated by github as a website. - copy all files from the forked repository into your new one (
clone
>copy/paste
) - README.md has all the instructions on how to make modifications to your site; play with those!
- you can pick a different theme for you site (just google
jekyll themes
for options)
- You can use this template https://github.com/daattali/beautiful-jekyll (the page also includes step-by-step instructions; our course website is built with this theme).
- Complete Codecademy’s Learn Git https://www.codecademy.com/learn/learn-git;
- if you’d like more practice, there is another one: https://try.github.io
- Publish your confirmation screenshot as a post on your new site;
- Complete the markdown tutorial @ https://www.markdowntutorial.com/. This will help you to write pages on your website