Goals
Learning about version control systems and how they help in the development of DH projects, 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
which does not require installation https://git-scm.com/download/win. For this, choose 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). In the folder, rungit-bash.exe
(for a more Unix-like command line) orgit-cmd.exe
(for Windows command line).
- you can also install a portable version of
- you can download it from https://git-scm.com/download/win. Please, choose 64-bit Git for Windows Setup.
- 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. - Note: there are also interface tools for github. We will not be working with them in the class, but you are welcome to test them on your own at home. See, https://desktop.github.com. The main reason for this is because interface tools will be different for different operating systems, while the command line usage will be exactly the same across all platforms.
- 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 repository (NB: this is done on https://github.com)clone
(NB: this is done on https://github.com!)- work
add
commit
push
/pull
- send
pull request
(NB: this is done on https://github.com)
Note: Steps 1 and 7 are relevant only when you work on a project (repository) that is owned by somebody else. If you work on a repository that you created under your account, you only need steps 2-6.
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 https://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 https://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
- Daniel van Strien. 2016. “An Introduction to Version Control Using GitHub Desktop,” The Programming Historian 5, https://programminghistorian.org/.
- Visconti, Amanda. 2016. “Building a Static Website with Jekyll and GitHub Pages.” Programming Historian, April. https://programminghistorian.org/.
- Simpkin, Sarah. 2015. “Getting Started with Markdown.” Programming Historian, November. https://programminghistorian.org/.
Homework
- Make sure to work through the readings given in the Reference materials above. They include all you need to know to complete the homework assignment.
- Your main assignment is to build your website on https://github.com.
- You can use this template https://github.com/daattali/beautiful-jekyll (the page also includes step-by-step instructions.
- 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.
- Complete the markdown tutorial @ https://www.markdowntutorial.com/. This will help you to write pages on your website.
Submitting homework:
- Homework assignment must be submitted by the beginning of the next class;
- Email your homework to the instructor.
- if your homework is to create a file, email it as an attachment
- if your homework is a blogpost on your website, email the link to your website and to the blogpost with your homework.
- In the subject of your email, please, add the following:
070112-LXX-HW-YourLastName-YourMatriculationNumber
, whereLXX
is the lesson for which the homework is submitted,YourLastName
is your last name, andYourMatriculationNumber
is your matriculation number.