SCMs – What, Why and How? <ul><li>Sawyer X
Sysadmin / Perl Ninja
User of Subversion, Git
Your host for this evening
Oh, and...
SCMs = Source Code Management systems </li></ul>
Why? <ul><li>The more work you do,
the more work you can lose
The more iterations you make,
the harder it is to keep track, and retrace
Undo  and  Redo  can only get you so far </li></ul>
Regular Work Cycle Work, work, work Good Bad Try something Shit! Retrace
How Do We Retrace? <ul><li>Keep backups in folders ( v1 ,  v2 ,  v2-stable , … )
Tarballs ( v1.tar.gz ,  v2.tar.gz ,  v2-final.tar.gz , … )
Comment out large code chunks
Write down notes ( README ,  help.txt , in code?)
Zip it all up and put it on Kazaa!
More... ? </li></ul>
What are SCMs? <ul><li>Source Code Management systems – we know!
An actual program
Helps you store all your code
And every change you've ever done
Has a few more nifty options
Also called VCS (Version Control System) </li></ul>
What the … ? Commit <ul>We use an SCM program to work with the repository </ul>Work Repository
Upcoming SlideShare
Loading in...5
×

Source Code Management systems

5,809

Published on

Why do we need them, what they are and how they work.

These are slides from a lecture given at TelFOSS at 22.04.10

Published in: Spiritual
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,809
On Slideshare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
56
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Source Code Management systems

  1. 1. SCMs – What, Why and How? <ul><li>Sawyer X
  2. 2. Sysadmin / Perl Ninja
  3. 3. User of Subversion, Git
  4. 4. Your host for this evening
  5. 5. Oh, and...
  6. 6. SCMs = Source Code Management systems </li></ul>
  7. 7. Why? <ul><li>The more work you do,
  8. 8. the more work you can lose
  9. 9. The more iterations you make,
  10. 10. the harder it is to keep track, and retrace
  11. 11. Undo and Redo can only get you so far </li></ul>
  12. 12. Regular Work Cycle Work, work, work Good Bad Try something Shit! Retrace
  13. 13. How Do We Retrace? <ul><li>Keep backups in folders ( v1 , v2 , v2-stable , … )
  14. 14. Tarballs ( v1.tar.gz , v2.tar.gz , v2-final.tar.gz , … )
  15. 15. Comment out large code chunks
  16. 16. Write down notes ( README , help.txt , in code?)
  17. 17. Zip it all up and put it on Kazaa!
  18. 18. More... ? </li></ul>
  19. 19. What are SCMs? <ul><li>Source Code Management systems – we know!
  20. 20. An actual program
  21. 21. Helps you store all your code
  22. 22. And every change you've ever done
  23. 23. Has a few more nifty options
  24. 24. Also called VCS (Version Control System) </li></ul>
  25. 25. What the … ? Commit <ul>We use an SCM program to work with the repository </ul>Work Repository
  26. 26. Regular Work Cycle - revisited Work, work, work Good Bad Try something Revert from last commit Commit
  27. 27. Comments <ul><li>Some people commit while working on new features
  28. 28. You can view the differences between the last commit you made with what you have now
  29. 29. You don't need to care about how the data is saved
  30. 30. … but if it helps, DB servers aren't involved :) </li></ul>
  31. 31. More SCM Features <ul><li>Atomic
  32. 32. Merging
  33. 33. Tags
  34. 34. Branches
  35. 35. Event Hooks
  36. 36. Blame
  37. 37. Bisect
  38. 38. ... </li></ul>
  39. 39. Centralized SCMs <ul><li>A master repository
  40. 40. It keeps the entire changeset
  41. 41. A commit pushes changes to the repository.
  42. 42. Examples: CVS, Subversion, Perforce </li></ul>
  43. 43. Decentralized/Distributed SCMs <ul><li>Each user/client is a repo
  44. 44. A commit is done to the local repo
  45. 45. You can have multiple remotes to push to
  46. 46. (… or a central one)
  47. 47. Can work and commit offline.
  48. 48. Examples: Git, Bazaar, Mercurial </li></ul>
  49. 49. Centralized Graph
  50. 50. Distributed Graph
  51. 51. Centralized
  52. 52. Distributed
  53. 53. New repo – Subversion style sawyer@potato:/repos$ svnadmin create project ferret@onion:~$ svn checkout svn+ssh://ferret@potato/repos/project Checked out revision 0. ferret@onion:~$ cd project ferret@onion:~/project$ echo &quot;hello&quot; > file ferret@onion:~/project$ svn add file A file ferret@onion:~/project$ svn commit -m &quot;adding a new file&quot; Adding file Transmitting file data . Committed revision 1.
  54. 54. New repo – Git style sawyer@potato:~/code/project$ git init Initialized empty Git repository in /home/sawyer/code/project/.git/ sawyer@potato:~/code/project$ echo &quot;hello&quot; > file sawyer@potato:~/code/project$ git add file sawyer@potato:~/code/project$ git commit -m &quot;adding a new file&quot; [master (root-commit) 961b958] adding a new file 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 file
  55. 55. Cooperation – Subversion style sawyer@potato:~$ svn checkout svn://svn.domain.com/project/trunk project sawyer@potato:~$ cd project … # work work work sawyer@potato:~/project$ svn commit -m &quot;improved output&quot; … # output trimmed sawyer@potato:~/project$ svn commit -m &quot;fixed bug #4&quot; … # output trimmed
  56. 56. Cooperation – Git style sawyer@potato:~$ git clone git://git.domain.com/project sawyer@potato:~$ cd project … # work work work sawyer@potato:~/project$ git commit -a -m &quot;improved output&quot; … # output trimmed sawyer@potato:~/project$ git commit certain_file -m &quot;fixed bug #4&quot; … # output trimmed sawyer@potato:~/project$ git push … # output trimmed
  57. 57. Diff the Data, Checking the log [email_address] :~/project$ git diff sawyer@potato:~/project$ git diff --cached sawyer@potato:~/project$ git diff f633d5 sawyer@potato:~/project$ git log sawyer@potato:~/project$ git log -p
  58. 58. Reverting Changes [email_address] :~/project$ git revert -m &quot;shouldn't have added that feature&quot; sawyer@potato:~/project$ git reset –hard 7f8a8bb6
  59. 59. Branching FTW [email_address] :~/project$ git checkout -b new_branch sawyer@potato:~/project$ git commit -m &quot;stuff...&quot; sawyer@potato:~/project$ git checkout master sawyer@potato:~/project$ git checkout new_branch sawyer@potato:~/project$ git branch
  60. 60. Branching – a Graph
  61. 61. Stages of Accepting SCMs <ul><li>Denial - „I don't need an SCM”
  62. 62. Anger - „Quit telling me I need it!”
  63. 63. Bargaining - „Maybe if I keep better track of my .tar.gz files...”
  64. 64. Depression - „I'll never learn to use SCMs” :(
  65. 65. Acceptance - „This is so cool, I'm gonna use this for everything! I wonder if I can legally marry my SCM...” </li></ul>
  66. 66. Resources! <ul>Git: <li>ProGit.org – Free book!
  67. 67. Github.com – Free repository hosting
  68. 68. Subversion:
  69. 69. Svnbook.Red-Bean.com – Free book!
  70. 70. Code.Google.com – Free repository hosting </li></ul>
  1. A particular slide catching your eye?

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

×