Subversion
                   Document Version Control with Subversion




tags: Version Control System, SVN, Introduction...
License



Sitdhibong Laokok : goto.champ@gmail.com
Agenda

• Advantage
• Commons Vocabulary
• Version Control System (VCS)
• Subversion in Actions
Agenda

• Advantage
• Commons Vocabulary
• Version Control System (VCS)
• Subversion in Actions
Advantage
• Backup and Restore
• Synchronization
• Short-term and Long-term undo
• Track Change and Ownership
• Sandboxing...
Agenda

• Advantage
• Commons Vocabulary
• Version Control System (VCS)
• Subversion in Actions
Commons Vocabulary
• Basic Setup
  “Repository(repo), Server, Client,Working Copy/Working Set,Trunk/
  Main,Baseline”

• B...
Basic Setup
Repository (repo)
  “The database stroring the files”
Server
  “The computer storing the repository”
Client
  “...
Basic Setup

Working Set / Working Copy
  “Your local directory of files, where you make
  change”
Trunk / Main
  “The “Pri...
Basic Setup

Baseline
  “An Approved revision (or version number) of
  a document or source file from which
  subsequent ch...
Basic Actions
Add
 “Put a file into the repo ‘for the first time’ ”
Revision
 “What version a file is on”
Head
 “The latest r...
Basic Actions
Check out
 “Download a file from the repo”
Check in / Commit
 “Upload a file into the repo.The file gets a
 new...
Basic Actions
Changelog / History
 “A list of change made to a file since it was
 created.”
Update / Sync
 “Synchronize you...
Basic Actions


Revert
 “Throw away your local changed and reload
 the latest version from repository”
Advanced Actions
Branch
  “Create a separate copy of a file/folder for
  private use (bug fixing, testing, etc.)”
Diff / Cha...
Advanced Actions
Conflict
 “When pending changes to a file contradict
 each other (both cannot be applied)”
Resolve
 “Fixing...
Advanced Actions

Locking
  “ ‘Taking Control’ of a file so nobody else can
  edit until you unlock it.”
Breaking the lock
...
Agenda

• Advantage
• Commons Vocabulary
• Version Control System (VCS)
• Subversion in Actions
Version Control System

• Git - Linux Kernel, X.org
• Subversion - Apache Software Foundation,
  PHP, Google Code
• Mercur...
Repository

    Project_name
      !   branches
      !   tags
      !   trunk


Recommend repository structure
Repository
         Repository



           X
 Write                  Read
               Read



X          X          X...
Versioning Model

• File Sharing
• Lock-Modify-Unlock
• Copy-Modify-Merge
File Sharing

                  X
               Repository




    X                        X
     Pat                   ...
File Sharing

                  X
               Repository




    X'                       X''
     Pat                 ...
File Sharing

                        X'
                     Repository




      X'                             X''
    ...
File Sharing

                      X''
                    Repository




      X'                             X''
      ...
Lock-Modify-Unlock

                         X
        Read                       Could not Read
                      Rep...
Lock-Modify-Unlock

                            X'
        Write                            Read
                         ...
Copy-Modify-Merge

                     X
   Read                              Read
                  Repository




     ...
Copy-Modify-Merge

                       X
                    Repository




      X'                            X''
   ...
Copy-Modify-Merge

                 X''
                                  Write
               Repository




  X'        ...
Copy-Modify-Merge

                    X''
 Could not write
                  Repository




    X'                       ...
Copy-Modify-Merge

   Read
                  X''
                Repository




  X' X''                         X''
   Pa...
Copy-Modify-Merge

                      Write
                                      X*
                                  ...
Agenda

• Advantage
• Commons Vocabulary
• Version Control System (VCS)
• Subversion in Actions
Subversion in Action

Require
• TortoiseSVN - Subversion Client
Optional
• VisualSVN Server - Subversion Server
Lab I: Check out


Objective
• To understand how to check out file from
  repository
Lab I: Check out




Before start you need to install TortoiseSVN
Lab I: Check out




Right-Click menu will show you like this if you already
                        install
Lab I: Check out




    Create a working copy directory
(empty directory in the location you want)
Lab I: Check out




Right-click then select “SVN Checkout...”
Lab I: Check out




Change “URL of repository” to your repository destination
Lab I: Check out




   Certificate Warning
Lab I: Check out




Authentication Required if the repository is not public
Lab I: Check out




   Check out success
Lab II: Add


Objective
• To understand how to ‘add’ new file or folder
  to repository
Lab II: Add




 Create new file or directory in your working copy, the
Symbol ‘?’ in front of folder show you this file is ...
Lab II: Add




Press Right-Click at file you want to add to repository, and
                     choose ‘SVN Add”
Lab II: Add




  Add dialog
Lab II: Add




                Add complete
REMEMBER YOUR FILE DOES NOT PUBLISH TO REPO
Lab II: Add




Commit complete: last line show you repository HEAD
Lab III: Update
Objective
• To understand how to ‘update’ file in SVN
• To solve problem when ‘conflict’ found
Note
• This i...
Lab III: Update




Right-Click in working copy, then choose “SVN Update”
Lab III: Update




This dialog shown you there are update available from repo
Lab III: Update




New file from repository
Lab III: Update




New file from repository [check out again]
Lab III: Update




 Make some changes to ‘note.odt’
you’ll see this in your working copy
Lab III: Update




Update before commit your file
Lab III: Update




   Conflict found!!!
Lab III: Update




 Use ‘Resolved’ to solved this problem
[Right-Click: TortoiseSVN > Resolved...]
Lab III: Update




Resolve dialog shown you the list of conflict file
Lab III: Update




Conflict list: you can ‘Accept’ or ‘Reject’ changes here
Lab III: Update




     Resolved
Lab III: Update




Content in file after conflict is resolved
Lab IV: Commit


Objective
• To understand how to commit file to
  repository
Lab IV: Commit




Press Right-Click in working copy
  then choose ‘SVN Commit...’
Lab IV: Commit




Commit dialog: the short description might helpful to you
                      co-worker
Lab IV: Commit




Commit complete: last line show repository HEAD
Lab V: Diff

Objective
• To understand and specify what difference
  between 2 revision
Note
• Diff stand for ‘Difference’
Lab V: Diff




Press Right-Click at file you want to see diff,
     then choose ‘TortoiseSVN > Diff’
Lab V: Diff




  Different list
Lab V: Diff




   diff with previous version list
‘TortoiseSVN > Diff with previous’
Lessen VI: Retrieve Log


Objective
 • To understand how to get change log in
   project
Lessen VI: Retrieve Log




Press Right-Click in working directory, then choose
            ‘TortoiseSVN > Show Log’
Lessen VI: Retrieve Log




      Log Message Dialog
References
Subversion
  http://subversion.tigris.org/
tortoiseSVN
  http://tortoisesvn.tigris.org/
Version Control with Su...
References

OOoSVN
 http://extensions.services.openoffice.org/
 project/OOoSVN
VisualSVN Server
 http://www.visualsvn.com/
Introduce to SVN
Upcoming SlideShare
Loading in...5
×

Introduce to SVN

7,871

Published on

Introduce you to basic SVN usage with TortoiseSVN (Windows Application)
https://dl.dropbox.com/u/492974/introduce-to-svn.pdf

Published in: Technology, Business
0 Comments
26 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
7,871
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
1
Comments
0
Likes
26
Embeds 0
No embeds

No notes for slide
  • - Backup and Restore: VCS จะทำงานโดยเก็บเอาแต่ล่ะ version ทำเป็น history ไว้ จึงช่วยเรื่องการจัดการเรืื่องการ backup และ restore งานตรง version ที่เราต้องการได้
    - Synchronization: ช่วยให้คนที่อยู่ใน Project ที่ทำงานร่วมกัน ได้ข้อมูลที่สอดคล้องกันทั้งหมด
    - Short-term and Long-term undo
    - short-term undo: หากไม่ต้องการเวอร์ชั่นที่ทำอยู่ หรือเกิดข้อผิดพลาดบางอย่างก็กลับไปเวอร์ชั่นที่ต้องการได้ทันที
    - long-term undo: ยกตัวอย่างเช่นถ้าปรับแก้ไปนานแล้วแต่พบว่ามันเป็นบั๊ก ก็สามารถกลับไปเวอร์ชั่นที่เริ่มเกิดนั้นและดูได้ว่าส่วนไหนที่เปลี่ยนแปลงแล้วส่งผลกระทบทำให้เกิดข้อผิดพลาดดังกล่าว
    - Track Change and Ownership: สามารถติดตามการเปลี่ยนแปลงในแต่ละเวอร์ชั่น และคนที่แก้ไขได้
    - Sandboxing: การใช้งาน vcs ก็คือจะให้คนที่ร่วมโปรเจ็คมาดึงเอาข้อมูลจากตรงกลางไปใช้ เมื่อเสร็จแล้วจึงค่อยส่งกลับคืนไปยังต้นฉบับ ดังนั้นเมื่อมีแก้ไขจะส่งผลกระทบเพียงแค่ที่ผู้ใช้คนดังกล่าวเท่านั้น
    - Branching and Merging: จาก sandboxing หากผู้ใช้ต้องการ ส่งโค้ดกลับมาที่ต้นฉบับ แต่ยังไม่ไดต้องการให้ไปรวมกับโค้ดหลัก ก็สามารถสร้างพื้นที่ส่วนหนึ่งแยกออกมาต่างหากจากที่อยู่ของโค้ดหลัก (branch) และเมื่อแก้ไขจนเป็นที่พอใจแล้ว ก็สามารถนำเอาโค้ดดังกล่าวกลับไปรวมกับโค้ดหลักได้ (merge)
  • Transcript of "Introduce to SVN"

    1. 1. Subversion Document Version Control with Subversion tags: Version Control System, SVN, Introduction Sitdhibong Laokok : goto.champ@gmail.com
    2. 2. License Sitdhibong Laokok : goto.champ@gmail.com
    3. 3. Agenda • Advantage • Commons Vocabulary • Version Control System (VCS) • Subversion in Actions
    4. 4. Agenda • Advantage • Commons Vocabulary • Version Control System (VCS) • Subversion in Actions
    5. 5. Advantage • Backup and Restore • Synchronization • Short-term and Long-term undo • Track Change and Ownership • Sandboxing • Branching and Merging
    6. 6. Agenda • Advantage • Commons Vocabulary • Version Control System (VCS) • Subversion in Actions
    7. 7. Commons Vocabulary • Basic Setup “Repository(repo), Server, Client,Working Copy/Working Set,Trunk/ Main,Baseline” • Basic Actions “Add, Revision, Head, Check out, Check in/Commit, Changelog/ History, Update/Sync, Revert” • Advanced Actions “Branch, Diff/Change/Delta, Merge(patch), Conflict, Resolve, Locking, Breaking the lock”
    8. 8. Basic Setup Repository (repo) “The database stroring the files” Server “The computer storing the repository” Client “The computer connecting to the repo”
    9. 9. Basic Setup Working Set / Working Copy “Your local directory of files, where you make change” Trunk / Main “The “Primary” location for code in the repo.”
    10. 10. Basic Setup Baseline “An Approved revision (or version number) of a document or source file from which subsequent changes can be made”
    11. 11. Basic Actions Add “Put a file into the repo ‘for the first time’ ” Revision “What version a file is on” Head “The latest revision in repo”
    12. 12. Basic Actions Check out “Download a file from the repo” Check in / Commit “Upload a file into the repo.The file gets a new revision number” Checkin Message “A short message to describe what was changed”
    13. 13. Basic Actions Changelog / History “A list of change made to a file since it was created.” Update / Sync “Synchronize your file with the latest from the repository”
    14. 14. Basic Actions Revert “Throw away your local changed and reload the latest version from repository”
    15. 15. Advanced Actions Branch “Create a separate copy of a file/folder for private use (bug fixing, testing, etc.)” Diff / Change / Delta “Finding the differences between two files” Merge (or patch) “Apply the changes from one file (or branch) to another file or trunk”
    16. 16. Advanced Actions Conflict “When pending changes to a file contradict each other (both cannot be applied)” Resolve “Fixing the changes that contradict each other and checking the correct version”
    17. 17. Advanced Actions Locking “ ‘Taking Control’ of a file so nobody else can edit until you unlock it.” Breaking the lock “Forcibly unlocking file that was locked”
    18. 18. Agenda • Advantage • Commons Vocabulary • Version Control System (VCS) • Subversion in Actions
    19. 19. Version Control System • Git - Linux Kernel, X.org • Subversion - Apache Software Foundation, PHP, Google Code • Mercurial - Mozilla projects, NetBeans, OpenJDK
    20. 20. Repository Project_name ! branches ! tags ! trunk Recommend repository structure
    21. 21. Repository Repository X Write Read Read X X X Client Client Client
    22. 22. Versioning Model • File Sharing • Lock-Modify-Unlock • Copy-Modify-Merge
    23. 23. File Sharing X Repository X X Pat Daniel Pat & Daniel read code from repository
    24. 24. File Sharing X Repository X' X'' Pat Daniel Pat & Daniel make change with there file
    25. 25. File Sharing X' Repository X' X'' Pat Daniel Pat write his file to repository. So, current version in the repository come from Pat
    26. 26. File Sharing X'' Repository X' X'' Pat Daniel Daniel do the same like Pat. But everything from Pat is overwrite by Daniel file
    27. 27. Lock-Modify-Unlock X Read Could not Read Repository Lock X X Pat Daniel Pat start with read file from repository and lock it
    28. 28. Lock-Modify-Unlock X' Write Read Repository Unlock X' X' Pat Daniel Pat write his changes to repository and unlock it
    29. 29. Copy-Modify-Merge X Read Read Repository X X Pat Daniel Pat and Daniel boat copy file from repository to his private directory (Working Copy)
    30. 30. Copy-Modify-Merge X Repository X' X'' Pat Daniel Pat and Daniel make changes in there working copy
    31. 31. Copy-Modify-Merge X'' Write Repository X' X'' Pat Daniel Daniel write his file to repository
    32. 32. Copy-Modify-Merge X'' Could not write Repository X' X'' Pat Daniel Pat could not write file to repository because his version is out-of-date
    33. 33. Copy-Modify-Merge Read X'' Repository X' X'' X'' Pat Daniel Solution: Pat read file from repository
    34. 34. Copy-Modify-Merge Write X* Repository X* X'' Pat Daniel Solution: Pat merge his file in working copy and new version from Repository then write it to repository
    35. 35. Agenda • Advantage • Commons Vocabulary • Version Control System (VCS) • Subversion in Actions
    36. 36. Subversion in Action Require • TortoiseSVN - Subversion Client Optional • VisualSVN Server - Subversion Server
    37. 37. Lab I: Check out Objective • To understand how to check out file from repository
    38. 38. Lab I: Check out Before start you need to install TortoiseSVN
    39. 39. Lab I: Check out Right-Click menu will show you like this if you already install
    40. 40. Lab I: Check out Create a working copy directory (empty directory in the location you want)
    41. 41. Lab I: Check out Right-click then select “SVN Checkout...”
    42. 42. Lab I: Check out Change “URL of repository” to your repository destination
    43. 43. Lab I: Check out Certificate Warning
    44. 44. Lab I: Check out Authentication Required if the repository is not public
    45. 45. Lab I: Check out Check out success
    46. 46. Lab II: Add Objective • To understand how to ‘add’ new file or folder to repository
    47. 47. Lab II: Add Create new file or directory in your working copy, the Symbol ‘?’ in front of folder show you this file is unknown
    48. 48. Lab II: Add Press Right-Click at file you want to add to repository, and choose ‘SVN Add”
    49. 49. Lab II: Add Add dialog
    50. 50. Lab II: Add Add complete REMEMBER YOUR FILE DOES NOT PUBLISH TO REPO
    51. 51. Lab II: Add Commit complete: last line show you repository HEAD
    52. 52. Lab III: Update Objective • To understand how to ‘update’ file in SVN • To solve problem when ‘conflict’ found Note • This is the best practice before you commit file to repository for avoid conflict
    53. 53. Lab III: Update Right-Click in working copy, then choose “SVN Update”
    54. 54. Lab III: Update This dialog shown you there are update available from repo
    55. 55. Lab III: Update New file from repository
    56. 56. Lab III: Update New file from repository [check out again]
    57. 57. Lab III: Update Make some changes to ‘note.odt’ you’ll see this in your working copy
    58. 58. Lab III: Update Update before commit your file
    59. 59. Lab III: Update Conflict found!!!
    60. 60. Lab III: Update Use ‘Resolved’ to solved this problem [Right-Click: TortoiseSVN > Resolved...]
    61. 61. Lab III: Update Resolve dialog shown you the list of conflict file
    62. 62. Lab III: Update Conflict list: you can ‘Accept’ or ‘Reject’ changes here
    63. 63. Lab III: Update Resolved
    64. 64. Lab III: Update Content in file after conflict is resolved
    65. 65. Lab IV: Commit Objective • To understand how to commit file to repository
    66. 66. Lab IV: Commit Press Right-Click in working copy then choose ‘SVN Commit...’
    67. 67. Lab IV: Commit Commit dialog: the short description might helpful to you co-worker
    68. 68. Lab IV: Commit Commit complete: last line show repository HEAD
    69. 69. Lab V: Diff Objective • To understand and specify what difference between 2 revision Note • Diff stand for ‘Difference’
    70. 70. Lab V: Diff Press Right-Click at file you want to see diff, then choose ‘TortoiseSVN > Diff’
    71. 71. Lab V: Diff Different list
    72. 72. Lab V: Diff diff with previous version list ‘TortoiseSVN > Diff with previous’
    73. 73. Lessen VI: Retrieve Log Objective • To understand how to get change log in project
    74. 74. Lessen VI: Retrieve Log Press Right-Click in working directory, then choose ‘TortoiseSVN > Show Log’
    75. 75. Lessen VI: Retrieve Log Log Message Dialog
    76. 76. References Subversion http://subversion.tigris.org/ tortoiseSVN http://tortoisesvn.tigris.org/ Version Control with Subversion http://svnbook.red-bean.com
    77. 77. References OOoSVN http://extensions.services.openoffice.org/ project/OOoSVN VisualSVN Server http://www.visualsvn.com/

    ×