What is Git/GitHub?
Getting started with git
git repositories are data-structures used to track changes to files over time
Git uses a two-stage commit process. Changes must first be added to the staging area, then committed from there
Sharing your work
remote repositories on GitHub help you collaborate
push is a Git verb for sending changes from the local repository to a remote repository
pull is a Git verb for bringing changes from a remote repository to the local repository
Basics - navigating the shell
print working directory
-l: list file information
-lh: list human readable file information
Basics - interacting with files
send file or files to output (in most cases, print to shell)
output first parts of a file or files
output last parts of a file or files
rename or move a file or files. Syntax for renaming a file:
mv FILENAME NEWFILENAME
copy a file or files. Syntax:
cp FILENAME NEWFILENAME
redirect output. Syntax with
cat FILENAME1 FILENAME2 > NEWFILENAME
remove a file or files. NB:
USE WITH CAUTION!!! Basic Git commands
Git cheat sheet handouts:
creates a git repository
view the status of your files in the working directory and staging area
tells git to start tracking a file, or a series of files.
commits ‘saves’ the staged snapshot to the project history.
commits the staged snapshot to the project history.
history of commits in reverse chronological order.
shows changes made to files
Merges upstream changes into your local repository
git remote add origin
add a repository where changes will be stored -
Useful library github repositories
The help pages of github are a good place to start: https://help.github.com/
Github has ‘activities’ which aim to explain how git works: https://guides.github.com/activities/hello-world/
Some indepth but clear tutorials on using git. https://www.atlassian.com/git/tutorials
A website aimed at historians but useful for librarians/those interested in Digital Humanities. The project uses Github and a programme called Jekyll to manage new lessons/the website. A useful place to see a non coding use of github in action: http://programminghistorian.org