-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorganized files into folders for each lab, added content for lab2
- Loading branch information
1 parent
3b2c7cc
commit 3528857
Showing
8 changed files
with
23,799 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
{ | ||
"metadata": { | ||
"name": "", | ||
"signature": "sha256:3780c4b365406547257760627a497aea925f3118088e8a762e783a01234edbfe" | ||
}, | ||
"nbformat": 3, | ||
"nbformat_minor": 0, | ||
"worksheets": [ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# GA Data Science 10 (DAT10) - git overview\n", | ||
"\n", | ||
"This lab is an overview and example of `git`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### 1. High Level Overview\n", | ||
"\n", | ||
"- the purpose of `git` is to keep snapshots of the *'state of the filesystem'* as it changes over time\n", | ||
"- git stores these snapshots in a *'repository'*\n", | ||
"- specifically, `git` data is kept in the `.git` folder in the top-level directory of the repo\n", | ||
"- i.e. there is a relationship between a `git` repo and the filesystem" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"There are two primary objects that are key to understanding `git`:\n", | ||
"#### `commit` object:\n", | ||
"\n", | ||
"- set of files (and directories) - i.e. a *'snapshot'*\n", | ||
"- pointer to one or more *parent* commit objects\n", | ||
"- unique name based on SHA1 hash\n", | ||
"- meta-data - e.g. commit message\n", | ||
"- commit process:\n", | ||
" - git add [filename]\n", | ||
" - git commit -m \"[insert message here]\"\n", | ||
"\n", | ||
"#### `head` object:\n", | ||
"\n", | ||
"- pointer to a `commit` object\n", | ||
"- each `head` has a name (i.e. the name of the branch)\n", | ||
"- at any given time there is a `head` that is the *'current head'*\n", | ||
"- the *'current head'* has the supplemental alias `HEAD`\n", | ||
"- by default there is a `head` called ***master*** in every repository" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"A `git` repository has a particular logical structure:\n", | ||
"\n", | ||
"- think of each `commit` object as a snapshot of the file system at a point in time\n", | ||
"- `commit` objects are linked together, forming a *directed graph*\n", | ||
"- the *'initial commit'* is the root of the graph\n", | ||
"- `head` objects are just pointers to specific `commits`" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### 2. `git` setup\n", | ||
"\n", | ||
"Copy the clone link from github:\n", | ||
"https://github.com/ga-students/DAT_SF_10\n", | ||
"\n", | ||
"$ git clone [link from github]\n", | ||
"\n", | ||
" - creates a new directory (i.e. with the name of the cloned repo)\n", | ||
" - initialize a new git repository in the new directory\n", | ||
" - copy all the commit objects and head references into the new repository\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Many settings are relative to the current repo, but some are set globally:\n", | ||
"\n", | ||
" $ git config global -l\n", | ||
" \n", | ||
" user.name=Dow Street\n", | ||
" [email protected]\n", | ||
" \n", | ||
" \n", | ||
"Additional settings, for example you can set your editor to something other than `vi` - e.g. `nano`:\n", | ||
" diff.external=/Users/dowstreet/bin/git-diff-cmd.sh\n", | ||
" merge.tool=opendiff\n", | ||
" color.ui=true\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Other useful commands:\n", | ||
"\n", | ||
" Use this all the time!\n", | ||
"\n", | ||
" $ git status\n", | ||
" \n", | ||
" Show the commit and branch graph\n", | ||
" \n", | ||
" $ git log --graph --oneline --all\n", | ||
" " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"collapsed": false, | ||
"input": [], | ||
"language": "python", | ||
"metadata": {}, | ||
"outputs": [] | ||
} | ||
], | ||
"metadata": {} | ||
} | ||
] | ||
} |
Oops, something went wrong.