2 Using Source Control effectively Nothing is ever “gone forever” Hoa Hoang.

Slides:



Advertisements
Similar presentations
TortoiseSVN By Group 1 Team B. Installing TortoiseSVN.
Advertisements

Intro to Version Control Have you ever …? Had an application crash and lose ALL of your work Made changes to a file for the worse and wished you could.
1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
TortoiseSVN Tutorial TortoiseSVN Tutorial By: Dung Nguyen Date: May 26 th, 2008 Duration: 1h30’ By: Dung Nguyen Date: May 26 th, 2008 Duration: 1h30’ Topic:
Version Control System (Sub)Version Control (SVN).
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
Revision Control Systems Amin Tootoonchian Kian Mirjalali.
Dedi Rahmawan Putra  Shared Document  Conventional Ways  Common Problems  What is TortoiseSVN  Advantages over another tools  Basic Concepts.
David Notkin Autumn 2009 CSE303 Lecture 22 Subversion is an open source version control system. Social Implications Friday version control system.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Version Control using Subversion Albert Young-Sun Kim November 2 nd, 2005 Available at entations/ subversion/
Version Control and Subversion Chris Coakley. Outline What is Version Control? Why use it? Using Subversion (SVN)
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Microsoft Visual Source Safe 6.01 Microsoft Visual Source Safe (MVSS) Presented By: Rachel Espinoza.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
SubVersioN – the new Central Service at DESY by Marian Gawron.
By Steven Campbell and Erik Boone.  Sharing projects by putting them into a central repository.  Checking out copies of projects from the repository.
Version Control. What is Version Control? Manages file sharing for Concurrent Development Keeps track of changes with Version Control SubVersion (SVN)
Source Code Revision Control Software CVS and Subversion (svn)
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
Introduction to Version Control
Source Control Repositories for Team Collaboration: SVN, TFS, Git.
The Design Workshop Introduction to Version Control 1.
The new version control system. Kiril Karaatanasov, July 2006 What is Subversion Subversion is a newly developed open source version control system Subversion.
Subversion, an Open Source Version Control System An Introduction.
Version Control with Subversion Quick Reference of Subversion.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
CVS 簡介 數位芝麻網路公司蔡志展 2001/8/18 大綱 • CVS 簡介 • CVS 安裝 • CVS 設定 (Linux/Windows) • CVS 指令簡介 • CVS 多人環境的應用.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Version control Using Git Version control, using Git1.
…using Git/Tortoise Git
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Version Control Menggunakan TortoiseSVN
(Sub)Version Control. 2 Keep large teams working on the same code Back up your work so you don't lose it all Compare changes to previous versions Revert.
Subversion (SVN) A Revision Control System Successor to CVS Carlos Armas Hervey Allen.
Introduction to Version Control SE-2030 Dr. Rob Hasker 1 Based on material at and slides written.
SENG 403 Tutorial 1 1SENG 403 – Winter Agenda Version Control Basics Subversion Basic actions in Subversion Some examples 2SENG 403 – Winter 2012.
DireXions – Your Tool Box just got Bigger PxPlus Version Control System Using TortoiseSVN Presented by: Jane Raymond.
Computer Science and Engineering The Ohio State University  Widely used, especially in the opensource community, to track all changes to a project and.
CSE 219 Computer Science III CVS
Subversion is a free/open-source version control system. It manages files and directories, and the changes made to them, over time. This allows you to.
Version Control with SVN Images from TortoiseSVN documentation
Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation.
When collaborating, it is important to manage changes in the models. For example: –To create or edit a submodel E.g. Habitat suitability is replaced with.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
L.T.E :: Learning Through Experimenting Using google-svn for MtM Docs Development Denis Thibault Version 3.2 Mar 12 th, 2009.
Sabriansyah R.A Version Control. The Repository Subversion adalah sistem tersentralisasi untuk informasi sharing Repository adalah pusat penyimpanan data.
Version Control and SVN ECE 297. Why Do We Need Version Control?
WinCVS Training è Basic Concepts è Download & Setup è Importing a new module into CVS Repository è Getting new module from CVS è Getting Latest version.
1 CSE 303 Lecture 19 Version control and Subversion ( svn ) slides created by Marty Stepp
TEAM FOUNDATION VERSION CONTROL AN OVERVIEW AND WALKTHROUGH By: Michael Mallar.
(1) Introduction to Subversion (SVN) and Google Project Hosting Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Source Control Repositories for Enabling Team Working Doncho Minkov Telerik Corporation
© CGI Group Inc. User Guide Subversion client TortoiseSVN.
NALINI S. NAUTIYAL SYSTEM SOFTWARE DIVISION Subversion.
DIGITAL REPOSITORIES CGDD Job Description… Senior Tools Programmer – pulled August 4 th, 2011 from Gamasutra.
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Git workflows: using multiple branches for parallel development SE-2800 Dr. Mark L. Hornick 1.
Source Control Dr. Scott Schaefer. Version Control Systems Allow for maintenance and archiving of multiple versions of code / other files Designed for.
Version Control with Subversion
SVN intro (review).
Source Control Dr. Scott Schaefer.
Concurrent Version Control
Version Control System
User Guide Subversion client TortoiseSVN
Subversion Basics Guide
Version Control 101 with Subversion
Presentation transcript:

2 Using Source Control effectively Nothing is ever “gone forever” Hoa Hoang

3 Agenda   Problems   Version Control System   Subversion - Tortoise SVN   7 habits of using SVN   Best Practices   Q & A

4 Problems  Users editing the same file concurrently overwriting each other

5 Problems  Many copy of source code on file server and local machine

6 Problems index.aspx  Accident of deletion, overwriting Data lost forever Unknown who, how, what, why, when, where files changed

7 Problems Problem & more…

8 Agenda   Problems   Version Control System   Subversion -Tortoise SVN   7 habits of using SVN   Best Practices   Q & A

9 Version control system  VCS is crucial to engineering and software development projects o Repository o Team-based collaboration o Record changes o Revision o History o Trunk o Branches / Tag

10 Version control system Version control server Repository Client Working copy Client  Repository Centralized stores of data. In SVN, data stored in the form of a filesystem tree by a hierarchy of files and directories

11 Version control system  Working copy o A ordinary directory tree of source code for projects checkout to your local hard drive. Were you can freely make changes => Creating revision

12 Version control system  Team-based collaboration

13 Version control system  Team-based collaboration

14 Version control system  Revision A version number associated with a chain of changes to the contents of a single or multiple Files/Directories in the Repository

15 Version control system revision 473 Index.html revision 415 revision 430 revision 472 revision 477  Revision

16 Version control system  Record changes who, what, why, when, where files changed

17 Version control system  History

18 Version control system  Project Project = directory Grouping of files/directories contained within repository Usually multiple Projects per Repository Project usually created as a named directory with the following structure project branches tags trunk

19 Version control system  Trunk trunk branch maintenance branch tag release merge 426

20 Version control system  Branchs A second copy of your document directory (project), maintaining separately and worked in parallel to the main codeline (Trunk)

21 Version control system  Tag A labeled snapshot of the directory (project) in time, or a Branch, at a particular Revision.

22

23 VCS Work-cycle  Check out To retrieve a directory from the Repository to view and/or edit the Resource. Allow to choose resource at a specific point o Head: Most recent revision o Revision#: most recent a specific revision number o Tag: A revision# marked as tag (Release) o Date: Specific date Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up Add

24 Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up  Modify Modify: Doing your work on working copy Lock file no nobody else can edit. Unlock when done VCS Work-cycle Add

25 Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up VCS Work-cycle  Revert When your changes become messy, want to get the good copy from repository overwrite back to working copy Add

26 Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up VCS Work-cycle  Cleanup  Rename  Delete  Add Add

27 Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up VCS Work-cycle  Update Downloading and merging all latest changes from repository into your working copy – (prevent conflict) Add

28 Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up VCS Work-cycle  Conflict Resolve conflict: Chose/modify if there some lines editing both by theirs and mine Add

29 Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up VCS Work-cycle  Merge/Different Merge: Often automatically done by subversion. If theirs code and mine code change on different line Add

30 VCS Work-cycle  Commit Check in/Commit: pushing edited files to repository (with a log message saying what you did) Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up Add

31 VCS Work-cycle  Branches  Tags  Import  Export Check Out Yes Star t Modify Update Commit Merge DeleteR evert Confl ict No Branch Tag End Mark resolved Rename Clean up Add

32 Revision control software  Subversion  Visual SourceSafe  StarTeam  CVS  AccuRev  …

33 Agenda   Problems   Version Control System   Subversion Tortoise SVN   7 habits of using SVN   Best Practices   Q & A

34 Subversion  A version control system, it handles any types of files, documents, or directories with these features o Atomic Commits o Windows-integrated (Tortoise SVN) o Directory base (not project-base) o Import directory (Project) o 2 versioning models o Copy-Modify-Merge o Lock-Modify-Unlock o Renaming revision o Branch/Tag/Merge/Different

35 Subversion  Benefit o Better binary file support o File/directory renaming o Metadata versioning o Better bandwidth usage o Multiple protocal (svn://, o Efficient branching and tagging o Many client tool & add-in support Eclipse, AnkSVN, InterliJ Idea, Visual Studio…Tortoise SVN o Ignoring o Revert/Cleanup o Comparing/Different

36 Subversion  Repository View o Connecting to repository o Browsing o Making revision link o Checking out  Synchronize View o Updating o Committing o Reverting o Conflict resolution  History View o Reviewing changes

37 Subversion  Apache base server o  SVN base server o svn://linuxtwo/repository/ABCProject  File system base server o file:///D:/repository/ABCProject

38 Tortoise SVN  Status of version controlled files/folders Green checkmark: normal status, under control Red exclamation: file has been modified since last update and needs to be committed. Yellow exclamation: a conflict occurs during an update. Grey checkmark: this file needs to be locked first before editing. Locked lock: file is locked. Need to unlock for other to commit. Red deletion: missing file or file to be deleted under version control. Blue plus: File to be added to version control.

39 Demo

40 Agenda   Problems   Version Control System   Subversion - Tortoise SVN   7 habits of using SVN   Best Practices   Q & A

41 7 habits of using SVN 1 Update/Commit source code every good changes Give comments for the commit

42 7 habits of using SVN 2 Update/Merge/Resolve conflict before Commit

43 7 habits of using SVN 3 Do not shy, do not stupid, do not blame when conflict. Quickly find ‘theirs’ and resolve together Do not shy, do not stupid, do not blame when conflict. Quickly find ‘theirs’ and resolve together

44 7 habits of using SVN 4 Use TortoiseSVN commands (delete, rename, copy) Do not use the Windows Explorer commands. Donot changes or remove the added svn files/folders

45 7 habits of using SVN 5 Delete your working copy and checkout new source every Monday

46 7 habits of using SVN 6 Don’t versioning by yourself

47 7 habits of using SVN 7 Use revert and cleanup when thing are messy Make ignore garbage files/directories before commit

48 Agenda   Problems   Version Control System   Subversion - Tortoise SVN   7 habits of using SVN   Best Practices   Q & A

49 Best Practices  Commit Often! The less time you spend with code you haven't committed, the less likely someone will edit a line you’ve not committed.  Commit in small chunks! The less code you change and don’t commit, the less likely someone will edit a line you’ve not committed.  Split your project into more than one file! You should be doing this anyways ? Avoiding Conflicts

50 Best Practices  Don’t commit broken code If someone else updates, they will have broken code too and will be unable to work unless they fix your mess  Don’t commit temporary/binary files We don’t need files like vore.vcproj.SNOWFIRE.philipd.user or any.exe or.obj files. They waste space! You MAY commit graphics as long as they aren’t too big. Binary files don’t get merged.  Don’t commit ginourmous files Remember, if you put it in the repository you force people to download it! A good alternative for optional files that are big is to put them on a web server – particularly if they don’t change What not to do…

51 Best Practices  When you commit, describe in the log as succinctly and clearly what you changed as possible This information will help others know what you did to the code  Add your new files If you make a new file, make sure to right click and add it to source control. If you don’t, others won’t be able to get it. EXAMPLE: In a game, you add a bitmap file. If you forget to add it to the subversion, when others synchronize, they download your code but not the bitmap. Now when they run the game, it crashes because it can’t find your file. What to do..

52 Agenda   Problems   Version Control System   Subversion - Tortoise SVN   7 habits of using SVN   Best Practices   Q & A

53 Q & A  How to obtain a “clean” working copy (original sources only) and exclude.svn folders. Select working copy>right-click>TortoiseSVN>Export Provide the destination folder for the “clean” working copy  How to leave (ignore) the files/folders not in source control Select files/folders in working copy not in source control Right-click>TortoiseSVN>Add to ignore list  How to add “free” files/folders (in working copy) into source control Select fils/folders>right-click>TortoiseSVN>Add Commit the working copy

54 Q & A  How to break/steal lock This is to break the locking on file by override the locking author. Check for modifications>select locked files>break lock, OR Right click>TortoiseSVN>Get lock, check the Steal option, OK. Recommend: should not use this function unless you have agreement of the PM.  Cannot login because of wrong SSL cache: clear cache First login to a wrong/forbidden link failed => wrong SSL is cached Later login (to correct link) also failed because the TortoiseSVN use the wrong cached SSL. Solution: right click>TortoiseSVN>Settings>Saved data>Authentication Data>Clear

55 Q & A  How to check out an SVN directory (recursively) to local existing folder? (Similar to get latest version in VSS & overwrite all local) Should checkout to an empty working copy. Existing working copy may cause file conflict or leave files not under source control.  How to get specific version of code from SVN? Select file/folder in the working copy TortoiseSVN>Update to revision… Select the option Revision, input desired revision You can Show log to know the log message.

56 More question?

57 Thank you !!!