Your SlideShare is downloading. ×
0
Version Control Chris Nagele Alex Hillman
Today's Agenda <ul><ul><li>A bit about us </li></ul></ul><ul><ul><li>A bit about version control </li></ul></ul><ul><ul><l...
We're from Wildbit <ul><li>Chris Nagele </li></ul><ul><li>Founder  </li></ul><ul><ul><li>Transitioned business from consul...
Beanstalkapp.com Go sign up for a free trial now!
Why Version Control?  
Why Version Control? cp index.html index-v12-old2.html
Why Version Control? cp index.html index-v12-old2.html There has to be a better way
The Old Way <ul><ul><li>Unmaintainable filesystems and filenames </li></ul></ul><ul><ul><li>Accidental overwriting of revi...
The New Way <ul><ul><li>Filenames stay the same! </li></ul></ul><ul><ul><li>Make changes with confidence - even revert! </...
Vocabulary Lesson <ul><ul><li>Repository </li></ul></ul><ul><ul><li>Track Changes </li></ul></ul><ul><ul><li>Add or Update...
Version Control Options  
Centralized  
Centralized Client & Server Relationship
Centralized Subversion  -  <ul><li>Benefits </li></ul><ul><ul><li>Easy to understand </li></ul></ul><ul><ul><li>More contr...
Decentralized (also known as Distributed) 
Decentralized A Network of Complete &quot;Repositories&quot;
Decentralized Git  & Mercurial  <ul><li>Benefits </li></ul><ul><ul><li>Powerful and detailed change tracking (you commit m...
Any questions so far?  
Get Git!  
Get Git! http://bit.ly/downloadgit - for OSX
Get Git! http://bit.ly/downloadgit - for OSX Other platform? Sorry! http://git-scm.com
Get Sample Files http://bit.ly/samplefiles
Terminal  
Global Config  
Global Config <ul><li>git config --global user.name &quot;Alex Hillman&quot; </li></ul><ul><li>git config --global user.em...
Global Config <ul><li>git config --global user.name &quot;Alex Hillman&quot; </li></ul><ul><li>git config --global user.em...
Global Config - Bonus! <ul><li>git config --global color.status auto </li></ul><ul><li>git config --global color.branch au...
Global Config - Textmate Bonus! <ul><li>git config --global core.editor &quot;mate -w&quot;     </li></ul><ul><li>Or repla...
Command Line Basics <ul><li>    pwd  - present working directory </li></ul><ul><li>    cd  - change directory </li></ul><u...
My First Repository You never forget your first
Ignoring Files It's nothing personal
Git Status What the hell is going on?
The Stage And how to get your files on it
PSA: Beware of  Empty Folders!  
Committing No diamond necessary
Committing Changes A little about &quot;insertions&quot; and &quot;deletions&quot; <ul><ul><li>Git is about &quot;content&...
Committing Changes A little about &quot;insertions&quot; and &quot;deletions&quot; <ul><ul><li>Git is about &quot;content&...
Inline Commits For quickies
Verbose Commits More to say? That's ok!
Stash Git's &quot;Clipboard&quot;
Commits as Communication Tasks, tickets, links, & more
Log What happened and when?
Remotes Don't change that channel
Sign up for Beanstalk! It’s ok…we’ll wait….
Keys
Keys <ul><li>ssh-keygen -t rsa </li></ul>
Keys <ul><li>ssh-keygen -t rsa </li></ul><ul><li>cat ~/.ssh/id_rsa.pub | pbcopy </li></ul>
Keys
Creating a Remote The Easy Way – with Beanstalk
git remote add
git push
git push beanstalk master
Remotes Connecting some dots between the command line and Beanstalk
Remotes I Think I’m A Clone Now
Catastophe Delete your work
git clone
git remote
git remote rename
git pull
git pull beanstalk master
Branches
git branch
git checkout
Branches + Remotes
git push beanstalk ________ where ________ is the name of your branch
git push beanstalk colorchange
git pull beanstalk colorchange
Integrating Changes Without A Time Traveling DeLorean.
Rebase
Rebase Check out progit.org
Merge
Make sure you’re on the branch you want to merge TO
git merge __________  Where __________ is the name of your branch you wish to merge in.
Keep that Repo Tidy
git branch –d __________ Where __________ is the name of your branch you wish to delete.
Conflict Resolution
You didn’t commit yet!
You didn’t commit yet! <ul><li>error: Your local changes to the following files would be overwritten by merge: </li></ul><...
You Did Commit! But…
You Did Commit! But… <ul><li>* branch  master  -> FETCH_HEAD </li></ul><ul><li>Auto-merging index.php </li></ul><ul><li>CO...
Conflict Delimiters
Commit, then push!
Where to learn more
Thank You! Chris Nagele – Alex Hillman http://www.beanstalkapp.com @beanstalkapp
Upcoming SlideShare
Loading in...5
×

Version Control ThinkVitamin

872

Published on

Chris Nagele and Alex Hillman of Wildbit (makers of http://beanstalkapp.com) give an intro to source control and Git for designers and VCS newbies.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
872
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Version Control ThinkVitamin"

  1. 1. Version Control Chris Nagele Alex Hillman
  2. 2. Today's Agenda <ul><ul><li>A bit about us </li></ul></ul><ul><ul><li>A bit about version control </li></ul></ul><ul><ul><li>A practical intro to Git </li></ul></ul>
  3. 3. We're from Wildbit <ul><li>Chris Nagele </li></ul><ul><li>Founder  </li></ul><ul><ul><li>Transitioned business from consulting to product </li></ul></ul><ul><ul><li>International Team - 7 countries represented </li></ul></ul><ul><ul><li>Writer - ThinkVitamin, etc </li></ul></ul><ul><ul><li>Spends days in the server closet  </li></ul></ul><ul><li>Alex Hillman </li></ul><ul><li>Business Development </li></ul><ul><ul><li>Web development background </li></ul></ul><ul><ul><li>Cofounded Indy Hall - Coworking in Philadelphia </li></ul></ul><ul><ul><li>Public Speaker - SXSW, etc </li></ul></ul><ul><ul><li>Spends days communicating with our customers </li></ul></ul>
  4. 4. Beanstalkapp.com Go sign up for a free trial now!
  5. 5. Why Version Control?  
  6. 6. Why Version Control? cp index.html index-v12-old2.html
  7. 7. Why Version Control? cp index.html index-v12-old2.html There has to be a better way
  8. 8. The Old Way <ul><ul><li>Unmaintainable filesystems and filenames </li></ul></ul><ul><ul><li>Accidental overwriting of revisions </li></ul></ul><ul><ul><li>Updates on live server </li></ul></ul><ul><ul><li>Communicate with team via e-mail </li></ul></ul><ul><ul><li>Multiple server management nightmare  </li></ul></ul><ul><li>  </li></ul>
  9. 9. The New Way <ul><ul><li>Filenames stay the same! </li></ul></ul><ul><ul><li>Make changes with confidence - even revert! </li></ul></ul><ul><ul><li>Source control as &quot;source&quot; for updates </li></ul></ul><ul><ul><li>Code as communication with the whole team </li></ul></ul><ul><ul><li>Deploy different versions to different servers easily </li></ul></ul><ul><li>  </li></ul>
  10. 10. Vocabulary Lesson <ul><ul><li>Repository </li></ul></ul><ul><ul><li>Track Changes </li></ul></ul><ul><ul><li>Add or Update Files </li></ul></ul><ul><ul><li>Commit Changes </li></ul></ul><ul><ul><li>Revision </li></ul></ul><ul><ul><li>Revert </li></ul></ul><ul><ul><li>Branch </li></ul></ul><ul><ul><li>Merge </li></ul></ul><ul><ul><li>Diff  </li></ul></ul>
  11. 11. Version Control Options  
  12. 12. Centralized  
  13. 13. Centralized Client & Server Relationship
  14. 14. Centralized Subversion -  <ul><li>Benefits </li></ul><ul><ul><li>Easy to understand </li></ul></ul><ul><ul><li>More control over users and access </li></ul></ul><ul><ul><li>More GUI & IDE clients </li></ul></ul><ul><ul><li>Simple to get started </li></ul></ul><ul><ul><li>Free & Open Source! </li></ul></ul><ul><li>Disadvantages </li></ul><ul><ul><li>Dependent on a server </li></ul></ul><ul><ul><li>Hard to manage a server (and backups!) </li></ul></ul><ul><ul><li>Slower </li></ul></ul><ul><ul><li>Some advanced tasks are very difficult </li></ul></ul>
  15. 15. Decentralized (also known as Distributed) 
  16. 16. Decentralized A Network of Complete &quot;Repositories&quot;
  17. 17. Decentralized Git  & Mercurial  <ul><li>Benefits </li></ul><ul><ul><li>Powerful and detailed change tracking (you commit more often) </li></ul></ul><ul><ul><li>No server necessary - everything is local </li></ul></ul><ul><ul><li>It's fast to branch and merge  </li></ul></ul><ul><ul><li>Free & Open Source! </li></ul></ul><ul><li>Disadvantages </li></ul><ul><ul><li>More to learn in order to  get started </li></ul></ul><ul><ul><li>Not as many GUI or IDE clients </li></ul></ul><ul><ul><li>It doesn't protect you from yourself </li></ul></ul>
  18. 18. Any questions so far?  
  19. 19. Get Git!  
  20. 20. Get Git! http://bit.ly/downloadgit - for OSX
  21. 21. Get Git! http://bit.ly/downloadgit - for OSX Other platform? Sorry! http://git-scm.com
  22. 22. Get Sample Files http://bit.ly/samplefiles
  23. 23. Terminal  
  24. 24. Global Config  
  25. 25. Global Config <ul><li>git config --global user.name &quot;Alex Hillman&quot; </li></ul><ul><li>git config --global user.email &quot;alex@wildbit.com&quot;   </li></ul>
  26. 26. Global Config <ul><li>git config --global user.name &quot;Alex Hillman&quot; </li></ul><ul><li>git config --global user.email &quot;alex@wildbit.com&quot;   </li></ul><ul><li>Verify: </li></ul><ul><li>git config --list </li></ul>
  27. 27. Global Config - Bonus! <ul><li>git config --global color.status auto </li></ul><ul><li>git config --global color.branch auto     </li></ul>
  28. 28. Global Config - Textmate Bonus! <ul><li>git config --global core.editor &quot;mate -w&quot;     </li></ul><ul><li>Or replace &quot;mate -w&quot; with your favorite text editor </li></ul>
  29. 29. Command Line Basics <ul><li>    pwd - present working directory </li></ul><ul><li>    cd - change directory </li></ul><ul><li>    cd .. - change directory up one folder level </li></ul><ul><li>    ls - list everything in present working directory </li></ul><ul><li>    mkdir - make directory </li></ul><ul><li>    cp - copy </li></ul><ul><li>    mv - move </li></ul>
  30. 30. My First Repository You never forget your first
  31. 31. Ignoring Files It's nothing personal
  32. 32. Git Status What the hell is going on?
  33. 33. The Stage And how to get your files on it
  34. 34. PSA: Beware of  Empty Folders!  
  35. 35. Committing No diamond necessary
  36. 36. Committing Changes A little about &quot;insertions&quot; and &quot;deletions&quot; <ul><ul><li>Git is about &quot;content&quot; </li></ul></ul><ul><ul><li>An insertion adds a new line of content </li></ul></ul><ul><ul><li>A deletion removes a line of content </li></ul></ul><ul><ul><li>A change is actually a deletion + an insertion </li></ul></ul><ul><li>  </li></ul>
  37. 37. Committing Changes A little about &quot;insertions&quot; and &quot;deletions&quot; <ul><ul><li>Git is about &quot;content&quot; </li></ul></ul><ul><ul><li>An insertion adds a new line of content </li></ul></ul><ul><ul><li>A deletion removes a line of content </li></ul></ul><ul><ul><li>A change is actually a deletion + an insertion </li></ul></ul><ul><ul><li>Every change is very small, so commit often </li></ul></ul><ul><ul><li>More commits = more communication </li></ul></ul>
  38. 38. Inline Commits For quickies
  39. 39. Verbose Commits More to say? That's ok!
  40. 40. Stash Git's &quot;Clipboard&quot;
  41. 41. Commits as Communication Tasks, tickets, links, & more
  42. 42. Log What happened and when?
  43. 43. Remotes Don't change that channel
  44. 44. Sign up for Beanstalk! It’s ok…we’ll wait….
  45. 45. Keys
  46. 46. Keys <ul><li>ssh-keygen -t rsa </li></ul>
  47. 47. Keys <ul><li>ssh-keygen -t rsa </li></ul><ul><li>cat ~/.ssh/id_rsa.pub | pbcopy </li></ul>
  48. 48. Keys
  49. 49. Creating a Remote The Easy Way – with Beanstalk
  50. 50. git remote add
  51. 51. git push
  52. 52. git push beanstalk master
  53. 53. Remotes Connecting some dots between the command line and Beanstalk
  54. 54. Remotes I Think I’m A Clone Now
  55. 55. Catastophe Delete your work
  56. 56. git clone
  57. 57. git remote
  58. 58. git remote rename
  59. 59. git pull
  60. 60. git pull beanstalk master
  61. 61. Branches
  62. 62. git branch
  63. 63. git checkout
  64. 64. Branches + Remotes
  65. 65. git push beanstalk ________ where ________ is the name of your branch
  66. 66. git push beanstalk colorchange
  67. 67. git pull beanstalk colorchange
  68. 68. Integrating Changes Without A Time Traveling DeLorean.
  69. 69. Rebase
  70. 70. Rebase Check out progit.org
  71. 71. Merge
  72. 72. Make sure you’re on the branch you want to merge TO
  73. 73. git merge __________ Where __________ is the name of your branch you wish to merge in.
  74. 74. Keep that Repo Tidy
  75. 75. git branch –d __________ Where __________ is the name of your branch you wish to delete.
  76. 76. Conflict Resolution
  77. 77. You didn’t commit yet!
  78. 78. You didn’t commit yet! <ul><li>error: Your local changes to the following files would be overwritten by merge: </li></ul><ul><li>index.php </li></ul><ul><li>Please, commit your changes or stash them before you can merge. </li></ul><ul><li>Aborting </li></ul>
  79. 79. You Did Commit! But…
  80. 80. You Did Commit! But… <ul><li>* branch master -> FETCH_HEAD </li></ul><ul><li>Auto-merging index.php </li></ul><ul><li>CONFLICT (content): Merge conflict in index.php </li></ul><ul><li>Automatic merge failed; fix conflicts and then commit the result. </li></ul>
  81. 81. Conflict Delimiters
  82. 82. Commit, then push!
  83. 83. Where to learn more
  84. 84. Thank You! Chris Nagele – Alex Hillman http://www.beanstalkapp.com @beanstalkapp
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×