version control with subversion

20

Upload: samnang-chhun

Post on 06-May-2015

4.432 views

Category:

Education


4 download

TRANSCRIPT

Page 1: Version Control With Subversion

L/O/G/O

[email protected]

Page 2: Version Control With Subversion

About Me

• Blog (http://tech.wowkhmer.com)

• Twitter (http://twitter.com/samnangchhun)

• Yoolk Inc. (http://www.yoolk.com)

• Rails Developer

• .NET Developer

Page 3: Version Control With Subversion

About this presentation

• Concepts of Version Control

• Subversion

• Daily Use Guide Demo

Page 4: Version Control With Subversion

What is Version Control?

“Revision control (also know as version

control, source control or (source) code

management (SCM)) is the management

of changes to documents, programs, and

other information stored as computer

files.” (source: Wikipedia:RevisionControl)

Page 5: Version Control With Subversion

No Version Cotrol

• Which version works?

• Which versions have

bug/feature X?

• What’s the different

between certain

versions?

Page 6: Version Control With Subversion

David & Bob working on the same project

No Version Control (Cont.)

• How to combine these

two version into one

working program?

• Who is responsible on

keeping the latest

version?David Bob

Banking System

Working on User

Management

Working on Loan

Management

The latest working version?

Page 7: Version Control With Subversion

Why need Version Control?

• Backup & Restore

• Synchronization

• Short-Term Undo

• Long-Term Undo

• Track Changes

• Track Owner

• Branching & Merging

Page 8: Version Control With Subversion

Types of Version Control

Centralized

• Client-Server System

• Repository stored on server

Decentralized

• Full decentralized, no server

• Each user has a copy of the full repository

Page 9: Version Control With Subversion

Available Tools

• CSV

• Subversion (svn)

• Microsoft Visual SourceSafe

• SVK

• Barzzar

• Mercurial (hg)

• Git

• etc…

Page 10: Version Control With Subversion

Subversion (SVN)

• Cross Platform / Open Source / Free.

• Central repository.

• Atomic commit.

• Availability of free client software / Plugin

for most known IDEs.

• Most of Open source hosting sites support

it. (e.g. codeplex, google code, and etc…)

Page 11: Version Control With Subversion

The Working Cycle

SubversionRepository

David BobWorking Copy Working Copy

Schema Access Method

file:// Direct repository access on local or network drive.

http:// Access via WebDAV protocol to Subversion-aware Apache server.

https:// Same as http://, but with SSL encryption.

svn:// Unauthenticated TCP/IP access via custom protocol to a svnserve server.

svn+ssh:// authenticated, encrypted TCP/IP access via custom protocol to a svnserve server.

Page 12: Version Control With Subversion

Subversion – Architecture

The revision numbers

0 1 2 3

Not just file management

but

management of changes

Page 13: Version Control With Subversion

Basic SVN Terminology

• Repository (repo): The database storing the

files.

• Working Copy: Your local directory of files,

where you make changes.

• Revision: What version a file is on (v1, v2, v3,

etc.).

• Check out: Download a file from the repo.

• Check in: Upload a file to the repository (if it has

changed). The file gets a new revision number,

and people can “check out” the latest one.

Page 14: Version Control With Subversion

Basic SVN Terminology

(Cont.)

• Update: Synchronize your files with the latest

from the repository. This lets you grab the latest

revisions of all files.

• Head: The latest revision in the repo.

• Changelog/History: A list of changes made to a

file since it was created.

• Revert: Throw away your local changes and

reload the latest version from the repository.

Page 15: Version Control With Subversion

Basic tools for SVN

• Client

– TortoiseSVN

– VisualSVN (commercial)

– AnkhSVN

• Server

– VisualSVN Server

Page 16: Version Control With Subversion

L/O/G/O

Page 17: Version Control With Subversion

Best Practices

• Comment, Comment, Comment

• Update and TEST before Commit

• Work from your own local copy

• Commit small autonomous changes

• Validate the files you are committing, you

actually changed

• Keep in touch with the repository.

• Watch for Conflicts

• Always group your check-in logically.

Page 19: Version Control With Subversion

L/O/G/O

Page 20: Version Control With Subversion

L/O/G/O