|What is Git/GitHub?||
|Getting started with git||
|Sharing your work||
Basics - navigating the shell
- print working directory
- list directory :
-l: list file information
-lh: list human readable file information
- change directory
Basics - interacting with files
- make directory
- 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
- DavidChouinard/mrc_to_csv: ‘Python script for converting MARC21 files to a saner format (CSV), originally designed for the Harvard Libraries MARC21 records’
- Process MARC records from Python
- umd-mith/git-intro: high level intro to git
- Python Programming for Humanities
- Code4Lib 2008 lightning talk – Git and distributed cataloging
- Open Science Guide
- The help pages of GitHub are a good place to start
- GitHub has ‘activities’ which aim to explain how git works
- GitHub also has interactive tutorials for their online version (Learning Labs) and for using Git offline (Git-It)
- Atlassian has in depth but clear tutorials on using git
- The Programming Historian uses GitHub to manage lessons useful to historians and also people working in libraries. It is a useful resource for lessons but also to see GitHub in action.