git in the van highedweb 2013
TRANSCRIPT
![Page 1: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/1.jpg)
![Page 2: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/2.jpg)
Question Who uses revision control?!
#TPR7!
![Page 3: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/3.jpg)
DIY Revision Control
• Duplicate and rename
• Track Changes / Save as Version
• Recovering the last auto-save
![Page 4: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/4.jpg)
“When you work within your confines, when you realize your limitations, that’s when you can break through them.”!
![Page 5: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/5.jpg)
Revision Control Systems
• Track changes to a set of files
• Mostly text edits
• Usually source code
![Page 6: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/6.jpg)
Common Systems
• Subversion (SVN)
• BitKeeper
• CVS, SVK, etc.
![Page 7: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/7.jpg)
Compare Them All
http://en.wikipedia.org/wiki/Comparison_of_revision_control_software
![Page 8: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/8.jpg)
Why Choose Git?
• Open Source (free)
• Distributed gives you autonomy
• Easy branching for experimenting
![Page 9: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/9.jpg)
How Git Works
#TPR7!
![Page 10: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/10.jpg)
The Δ It’s Efficient
• Revisions, not versions
• Repo stores all changes – 1st change: git init!
• Each change links to previous
![Page 11: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/11.jpg)
The 3 Areas
• Working Copy
• Staging Index
• Repo
![Page 12: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/12.jpg)
Working Copy
Staging Index
Repo
![Page 13: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/13.jpg)
“I was learning a lot of things fast.”!
![Page 14: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/14.jpg)
An Analogy Packing a suitcase!
#TPR7!
![Page 15: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/15.jpg)
Step 1: All the Things!
• Take some shirts out of the closet
• Throw them on the bed
![Page 16: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/16.jpg)
Working Copy
Staging Index
Repo
![Page 17: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/17.jpg)
Step 2: Just These Things
• Choose a few shirts
• Prepare them for packing
![Page 18: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/18.jpg)
Working Copy
Staging Index
Repo
![Page 19: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/19.jpg)
Step 3: Pack the Things
• Put the shirts in the suitcase
![Page 20: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/20.jpg)
Working Copy
Staging Index
Repo
![Page 21: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/21.jpg)
An Example Packing pants!
![Page 22: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/22.jpg)
Step 1
• Take pants out of the closet
• Touched the pants – that’s an edit
• The pants are in your working copy
![Page 23: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/23.jpg)
Working Copy
Staging Index
Repo
![Page 24: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/24.jpg)
Step 2
• Choose a few pants, fold them up
• Selected a change – that’s an add
• The pants are in your staging index
![Page 25: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/25.jpg)
Working Copy
Staging Index
Repo
![Page 26: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/26.jpg)
Step 3
• Put the folded pants in your suitcase
• Packed the pants – that’s a commit
• The pants are in your repo
![Page 27: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/27.jpg)
Working Copy
Staging Index
Repo
![Page 28: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/28.jpg)
Another Example This time, with commands!!
![Page 29: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/29.jpg)
Step 1
• Take socks out of the drawer
• COMMAND: (none) – Git compares current files to repo – Changes go in working copy
automatically
![Page 30: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/30.jpg)
Working Copy
Staging Index
Repo
![Page 31: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/31.jpg)
Step 2
• Pick a few socks, roll them up
• COMMAND: git add – Moves changes to staging index – Works for edited files or new files
![Page 32: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/32.jpg)
Working Copy
Staging Index
Repo
git add
![Page 33: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/33.jpg)
Step 3
• Pack the socks in your suitcase
• COMMAND: git commit – Records the changes to your repo – Can be a single change or many
![Page 34: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/34.jpg)
Working Copy
Staging Index
Repo
git commit
![Page 35: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/35.jpg)
Step 4
• Put unused clothes away
• COMMAND: git checkout – Erases changes from the working copy – A good way to get out of a bad situation
![Page 36: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/36.jpg)
Working Copy
Working Copy
git checkout!
![Page 37: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/37.jpg)
Commit #1
Commit #2
Commit #3
![Page 38: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/38.jpg)
“After all the weeks of practice I felt ready to play.”!
![Page 39: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/39.jpg)
A Demo With Terminal and the GitHub app!
![Page 40: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/40.jpg)
State of the Repo Sequential changes!
![Page 41: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/41.jpg)
Commit #1
Commit #2
Commit #3
HEAD
![Page 42: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/42.jpg)
Branches Want to try something?!
![Page 43: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/43.jpg)
Making Branches
git branch <name>!!
• Clones the repo
• New working copy and staging index
• Git Flow – a branching model
![Page 44: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/44.jpg)
Switching Branches
git checkout <name>!
• Quickly swap to a different branch
• Changes what’s in your editor
• Changes what’s in the browser
![Page 45: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/45.jpg)
An Example Going to Jamaica!
![Page 46: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/46.jpg)
Rewind the Repo
git checkout <commit2>!!
• Set the HEAD to commit #2
![Page 47: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/47.jpg)
Commit #1
Commit #2
Commit #3
HEAD
![Page 48: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/48.jpg)
Commit #1
Commit #2
Commit #3
HEAD
![Page 49: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/49.jpg)
Branch the Rewind
git checkout – b <branchName>! • Make a new branch off that commit
![Page 50: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/50.jpg)
Master Jamaica
![Page 51: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/51.jpg)
Working Copy
Staging Index
Repo
![Page 52: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/52.jpg)
Get a Passport
• A new item, not yet tracked
• COMMAND: git add – Skip the working copy – Add directly to staging index
!
![Page 53: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/53.jpg)
Working Copy
Staging Index
Repo
git add
![Page 54: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/54.jpg)
Pack the Passport
• Pack the passport
• COMMAND: git commit – Add to the repo
![Page 55: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/55.jpg)
Working Copy
Staging Index
Repo
![Page 56: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/56.jpg)
Merge the Changes
• Add the change to the master branch
• COMMAND: git merge – Merge all changes or cherry pick
![Page 57: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/57.jpg)
Master Jamaica
![Page 58: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/58.jpg)
Master Jamaica
![Page 59: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/59.jpg)
Demo Time Checkout prior commit, branch, merge
![Page 60: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/60.jpg)
GitHub.com “Just do it like it’s all you knew how to do.”!
![Page 61: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/61.jpg)
Learn More
• http://try.github.io
• “Git Essential Training” by Kevin Skoglund on Lynda.com
• http://git-scm.com/book
![Page 62: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/62.jpg)
Clone This Rep
!https://github.com/brufftech/git-suitcase.git
![Page 63: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/63.jpg)
Credits
• Quotes from Get in the Van by Henry Rollins
• Designer: Jacob Melton [email protected]
• Presenter: Annette Liskey [email protected]
![Page 64: Git in the Van HighEdWeb 2013](https://reader033.vdocuments.us/reader033/viewer/2022052700/55a1ac3a1a28abbc798b4595/html5/thumbnails/64.jpg)
Questions?