What is It?
Why Use it?
Git’s Worldview
Creating a Project
Changing a Project
Sharing a Project
$ ls
Paper.doc
Paper-aug-30-300.doc
Paper-aug-4-700.doc
Paper-aug-4-800.doc
Paper-jul-31-730.doc
Paper-sept-1-830.doc
$ cp Paper.doc Paper-nov-8-400.doc
$ ls
website/
website-aug-30-300.zip
website-aug-4-700.zip
website-aug-4-800.zip
$ zip -r website website-nov-8-400.doc
$ git config --global user.name "Eric Rochester"
$ git config --global user.email "erochest@virginia.edu"
$ mkdir new-site
$ cd new-site
$ git init
Initialized empty Git repository in /Users/err8n/tmp/new-site/.git/
$ touch index.html
Edit index.html
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# index.html
nothing added to commit but untracked files present (use "git add" to track)
$ git add index.html
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: index.html
#
$ git commit -m "initial import"
[master (root-commit) 2c49bf0] initial import
1 file changed, 15 insertions(+)
create mode 100644 index.html
$ git status
# On branch master
nothing to commit, working directory clean
$ git log
commit 2c49bf0977c74ce232cb52fcb8d129e32ee94f28
Author: Eric Rochester <erochest@virginia.edu>
Date: Thu Nov 7 15:24:46 2013 -0500
initial import
Edit index.html again.
$ touch style.css
Edit style.css
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: index.html
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# style.css
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff
diff --git a/index.html b/index.html
index 8a5f865..6f7d64e 100644
--- a/index.html
+++ b/index.html
@@ -3,6 +3,7 @@
<head>
<title></title>
<meta charset="utf-8" />
+ <link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<header>
$ git add index.html style.css
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.html
# new file: style.css
#
$ git commit -m "A little bit stylish."
[master 740343e] A little bit stylish.
2 files changed, 4 insertions(+)
create mode 100644 style.css
$ git status
# On branch master
nothing to commit, working directory clean
$ git log
commit 740343ec54003a3c70ea2faef961ee22b4c0e2ff
Author: Eric Rochester <erochest@virginia.edu>
Date: Thu Nov 7 16:57:05 2013 -0500
A little bit stylish.
commit 2c49bf0977c74ce232cb52fcb8d129e32ee94f28
Author: Eric Rochester <erochest@virginia.edu>
Date: Thu Nov 7 15:24:46 2013 -0500
initial import
The unholy spawn of Facebook and git.
Let’s get an account!
https://github.com
Create a new repository on Github.
$ git remote add origin git@github.com:erochest/new-site.git
$ git push -u origin master
http://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf