Permalink
Browse files

about done with tree work section

  • Loading branch information...
1 parent 813edc6 commit 2fc5339a81236ad4151ae1b021d67a062a63cfba @schacon committed Mar 31, 2011
View
1 .gitignore
@@ -0,0 +1 @@
+*.graffle
View
16 custom.css
@@ -14,6 +14,18 @@
color: #000;
}
+.example pre {
+ position: absolute;
+ top: 100px;
+ font-size: 27px;
+ color: #000;
+}
+
+.example pre strong { color: #ff7f00; }
+
+.green { color: #3a4; }
+.red { color: #a34; }
+
.bigcode pre code { font-size: 1.3em; }
.blockimg img {
@@ -58,6 +70,10 @@ h1 {
border-bottom: 40px;
}
+.bold h1 {
+ color: #BE260D !important;
+}
+
.subsec h1 {
font-weight: bolder;
font-size: 160px;
View
10 final/01_final.md
@@ -3,3 +3,13 @@
# CODA #
## Back to the roots ##
+
+!SLIDE
+
+# thanks! #
+
+!SLIDE
+
+# questions? #
+
+
View
176 the_trees/01_trees.md
@@ -0,0 +1,176 @@
+!SLIDE center subsection
+
+# The Trees #
+
+!SLIDE center
+
+# HEAD, index, work tree #
+
+!SLIDE center
+
+![trees](areas.png)
+
+!SLIDE
+
+# Environment Variables #
+
+!SLIDE
+
+## moving around your git pieces ##
+
+!SLIDE bullets incremental
+
+* git directory
+* index file
+* working directory
+
+!SLIDE code
+
+# GIT_DIR #
+
+!SLIDE commandline incremental
+
+ $ mv .git /opt/repo.git
+
+ $ git --git-dir=/opt/repo.git log
+
+ $ export GIT_DIR=/opt/repo.git
+ $ git log
+
+!SLIDE code
+
+# GIT_INDEX_FILE #
+
+!SLIDE commandline incremental
+
+ $ git status -s
+ M README
+ M kidgloves.rb
+
+ $ git add kidgloves.rb
+
+ $ git status -s
+ M README
+ S kidgloves.rb
+
+!SLIDE commandline incremental
+
+ $ export GIT_INDEX_FILE=/tmp/index
+ $ git read-tree HEAD
+ $ git add README
+
+ $ git status -s
+ S README
+ M kidgloves.rb
+
+!SLIDE commandline incremental
+
+ $ unset GIT_INDEX_FILE
+
+ $ git status -s
+ M README
+ S kidgloves.rb
+
+ $ export GIT_INDEX_FILE=/tmp/index
+
+ $ git status -s
+ S README
+ M kidgloves.rb
+
+!SLIDE code
+
+# GIT_WORK_TREE #
+
+!SLIDE commandline incremental
+
+ $ git status -s
+ M README
+ S kidgloves.rb
+
+ $ export GIT_DIR=$(pwd)/.git
+ $ export GIT_WORK_TREE=$(pwd)
+
+ $ cd /tmp
+ $ git status -s
+ M README
+ S kidgloves.rb
+
+!SLIDE center
+
+# Using Reset #
+
+## Managing your trees ##
+
+!SLIDE center
+
+![trees](areas.png)
+
+!SLIDE bullets incremental
+
+* It points the HEAD ref at a new 'target' commit, if you specified one.
+* Then it copies the tree of the HEAD commit to the index, unless you said --soft.
+* Finally, it copies the contents of the index to the working tree, if you said --hard.
+
+!SLIDE center
+![trees](reset-c1.png)
+
+!SLIDE center
+![trees](reset-c2.png)
+
+!SLIDE center
+![trees](reset-c3.png)
+
+!SLIDE center
+![trees](reset-c4.png)
+
+!SLIDE code
+
+# git reset #
+
+!SLIDE center
+![trees](reset-c4.png)
+
+!SLIDE center
+![trees](reset-soft.png)
+
+!SLIDE center
+![trees](reset-mixed.png)
+
+!SLIDE center
+![trees](reset-hard.png)
+
+!SLIDE
+
+# examples #
+
+!SLIDE
+
+# unstaging changes #
+
+!SLIDE code small
+
+# git reset [--mixed] HEAD -- file #
+
+## sets index to HEAD ##
+
+!SLIDE
+
+# undo last commit #
+
+!SLIDE code small
+
+# git reset [--mixed] HEAD~ #
+
+## moves HEAD back and moves index back ##
+
+!SLIDE
+
+# squash the last 2 commits into a new one #
+
+!SLIDE code small
+
+# git reset --soft HEAD~2 #
+# git commit #
+
+## moves HEAD back, keeps index ##
+
View
BIN the_trees/areas.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN the_trees/progit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN the_trees/reset-c1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN the_trees/reset-c2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN the_trees/reset-c3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN the_trees/reset-c4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN the_trees/reset-hard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN the_trees/reset-mixed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN the_trees/reset-soft.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
316 treework/01_treework.md
@@ -4,3 +4,319 @@
## Working With Trees ##
+!SLIDE subsec bold
+
+# git status #
+
+!SLIDE example
+
+<pre>
+<b>$ git status</b>
+# On branch master
+# Your branch is behind 'origin/master' by 2 commits,
+# and can be fast-forwarded.
+#
+# Changes to be committed:
+# (use "git reset HEAD <file>..." to unstage)
+#
+# <span class="green">modified: jobs/email_reply.rb</span>
+#
+# Changed but not updated:
+# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes
+# in working directory)
+#
+# <span class="red">modified: app/helpers/users_helper.rb</span>
+# <span class="red">modified: test/unit/email_reply_job_test.rb</span>
+#
+</pre>
+
+!SLIDE example
+
+<pre>
+<b>$ git status</b>
+# On branch master
+# Your branch is behind 'origin/master' by 2 commits,
+# and can be fast-forwarded.
+#
+# Changes to be committed:
+# <strong>HEAD and index differ</strong>
+#
+# <span class="green">modified: jobs/email_reply.rb</span>
+#
+# Changed but not updated:
+# <strong>index and working directory differ</strong>
+#
+#
+#
+# <span class="red">modified: app/helpers/users_helper.rb</span>
+# <span class="red">modified: test/unit/email_reply_job_test.rb</span>
+#
+</pre>
+
+!SLIDE center
+
+![only a file](ex1.png)
+
+!SLIDE center
+
+![git init](ex2.png)
+
+!SLIDE center
+
+![git add](ex3.png)
+
+!SLIDE center
+
+![git commit](ex4.png)
+
+!SLIDE center
+
+![modify](ex5.png)
+
+!SLIDE
+
+<pre>
+<b>$ git status</b>
+# On branch master
+# Your branch is behind 'origin/master' by 2 commits,
+# and can be fast-forwarded.
+#
+# Changed but not updated:
+# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes
+# in working directory)
+#
+# <span class="red">modified: file.txt</span>
+#
+</pre>
+
+!SLIDE center
+
+![modify](ex5.png)
+
+!SLIDE center
+
+![git add](ex6.png)
+
+!SLIDE
+
+<pre>
+<b>$ git status</b>
+# On branch master
+# Your branch is behind 'origin/master' by 2 commits,
+# and can be fast-forwarded.
+#
+# Changes to be committed:
+# (use "git reset HEAD <file>..." to unstage)
+#
+# <span class="green">modified: file.txt</span>
+#
+</pre>
+
+!SLIDE center
+
+![git add](ex6.png)
+
+!SLIDE center
+
+![git commit](ex7.png)
+
+!SLIDE subsec bold
+
+# git reset #
+
+!SLIDE subsec
+
+# 2 forms #
+
+!SLIDE code smaller
+
+# git reset [commit] [path] #
+
+# git reset [commit] #
+
+!SLIDE code
+
+# 1. Path Form #
+
+## git reset [commit] [path] ##
+
+!SLIDE
+
+## `git reset [file]` ##
+
+# is the opposite of #
+
+## `git add [file]` ##
+
+!SLIDE
+
+![](reset-path1.png)
+
+!SLIDE
+
+![](reset-path2.png)
+
+!SLIDE
+
+# Reset to <br/> an older file #
+
+!SLIDE
+
+![](reset1.png)
+
+!SLIDE
+
+![](reset-path3.png)
+
+!SLIDE
+
+<pre>
+<b>$ git status</b>
+# On branch master
+# Changes to be committed:
+# (use "git reset HEAD <file>..." to unstage)
+#
+# <span class="green">modified: file.txt</span>
+#
+# Changed but not updated:
+# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
+#
+# <span class="red">modified: file.txt</span>
+#
+</pre>
+
+!SLIDE code
+
+# 2. Commit Form #
+
+## git reset [commit] ##
+
+!SLIDE bullets list incremental
+
+# Reset Options #
+
+* **--soft** move HEAD to target
+* **[--mixed]** then copy to index
+* **--hard** then copy to work dir
+
+!SLIDE title
+
+# --soft #
+
+## move HEAD to another commit ##
+
+!SLIDE center
+
+![git commit](reset1.png)
+
+!SLIDE center
+
+![reset soft](reset-soft.png)
+
+!SLIDE title
+
+# --mixed #
+
+## move HEAD to another commit, then copy into index ##
+
+!SLIDE center
+
+![git commit](reset1.png)
+
+!SLIDE center
+
+![reset soft](reset-mixed.png)
+
+!SLIDE title
+
+# --hard #
+
+## move HEAD, copy to index, copy to working directory ##
+
+!SLIDE center
+
+![git commit](reset1.png)
+
+!SLIDE center
+
+![reset soft](reset-hard.png)
+
+!SLIDE
+
+# WTFWIEWTUT #
+### whythefuckwouldieverwanttousethis ###
+
+
+!SLIDE
+
+# unstaging changes #
+
+!SLIDE code
+
+## git reset HEAD -- file ##
+
+!SLIDE
+
+![](reset-path1.png)
+
+
+!SLIDE
+
+# undo last commit #
+
+!SLIDE small
+
+# `git reset [--mixed] HEAD~` #
+
+## moves HEAD back and moves index back ##
+
+!SLIDE
+
+![](reset1.png)
+
+!SLIDE
+
+![](reset-mixed.png)
+
+!SLIDE
+
+# squash the last 2 commits into one #
+
+!SLIDE small
+
+# git reset --soft HEAD~2 #
+# git commit #
+
+## moves HEAD back, keeps index ##
+
+!SLIDE
+
+![](reset1.png)
+
+!SLIDE
+
+![](squash1.png)
+
+!SLIDE
+
+![](squash2.png)
+
+
+
+!SLIDE
+
+# &lt;/reset>
+
+!SLIDE center
+
+![cert](cert.jpg)
+
+!SLIDE subsec bold
+
+# git checkout #
+
+
+
View
BIN treework/cert.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/ex1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/ex2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/ex3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/ex4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/ex5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/ex6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/ex7.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/reset-hard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/reset-mixed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/reset-path1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/reset-path2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/reset-path3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/reset-soft.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/reset1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/squash1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN treework/squash2.png
Diff not rendered.

0 comments on commit 2fc5339

Please sign in to comment.