Version Control Using Subversion. Version Control Using Subversion 1 / 27



Similar documents
Version Control with Subversion and Xcode

Subversion workflow guide

Source Control Systems

Beginning with SubclipseSVN

Version Control with Subversion

Version Control Tutorial using TortoiseSVN and. TortoiseGit

Using SVN to Manage Source RTL

Version control. HEAD is the name of the latest revision in the repository. It can be used in subversion rather than the latest revision number.

CS 2112 Lab: Version Control

Version Control! Scenarios, Working with Git!

Introduction to Subversion

Using Git for Project Management with µvision

Revision control systems (RCS) and

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

Using SVN to Manage Source RTL

MATLAB & Git Versioning: The Very Basics

SVN Starter s Guide Compiled by Pearl Guterman June 2005

TOAD and SubVersion - A Quick How To. Norman Dunbar of Dunbar IT Consultants Ltd.

INF 111 / CSE 121. Homework 4: Subversion Due Tuesday, July 14, 2009

Introducing Xcode Source Control

Version control with Subversion

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

EAE-MS SCCAPI based Version Control System

Using Subversion in Computer Science

Version Control. Version Control

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

Version Control with Subversion

CONNECTING TO DEPARTMENT OF COMPUTER SCIENCE SERVERS BOTH FROM ON AND OFF CAMPUS USING TUNNELING, PuTTY, AND VNC Client Utilities

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

BlueJ Teamwork Tutorial

Data management on HPC platforms

Subversion Integration for Visual Studio

QlikView 11 Source Control Walkthrough

Practice Fusion API Client Installation Guide for Windows

Version Control. Luka Milovanov

The Einstein Depot server

How to set up SQL Source Control. The short guide for evaluators

How to install and use the File Sharing Outlook Plugin

PxPlus Version Control System Using TortoiseSVN. Jane Raymond

Ingeniørh. Version Control also known as Configuration Management

DAVE Usage with SVN. Presentation and Tutorial v 2.0. May, 2014

Git Basics. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 22

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

Mapping the ITS File Server Folders to Mosaic Windows

Lab 0 (Setting up your Development Environment) Week 1

Subversion. Nadir SOUALEM. Linux Users subversion client svn or higher. Windows users subversion client Tortoise 1.6.

Work. MATLAB Source Control Using Git

Derived from Chris Cannam's original at, an.

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

Mapping ITS s File Server Folder to Mosaic Windows to Publish a Website

Setting up a local working copy with SVN, MAMP and rsync. Agentic

SourceAnywhere Service Configurator can be launched from Start -> All Programs -> Dynamsoft SourceAnywhere Server.

Running your first Linux Program

MOOSE-Based Application Development on GitLab

Setting up the Oracle Warehouse Builder Project. Topics. Overview. Purpose

Software Delivery Integration and Source Code Management. for Suppliers

Version Control with. Ben Morgan

Extending Remote Desktop for Large Installations. Distributed Package Installs

SVN Setup and Configuration Management

1. Product Information

Source Control Guide: Git

Online Backup Client User Manual Linux

Version control with GIT

Version Control Script

Xcode Source Management Guide. (Legacy)

CS108, Stanford Handout #33. CVS in Eclipse

Zoom Plug-ins for Adobe

WORKING IN TEAMS WITH CASECOMPLETE AND MICROSOFT VISUAL SOURCE SAFE. Contents

RecoveryVault Express Client User Manual

ProjectWise Explorer V8i User Manual for Subconsultants & Team Members

Version Control Using Subversion. 12 May 2013 OSU CSE 1

Lab Exercise Part II: Git: A distributed version control system

Sitecore InDesign Connector 1.1

Mercurial. Why version control (Single users)

Online Backup Linux Client User Manual

Version Control with Git. Kate Hedstrom ARSC, UAF

Online Backup Client User Manual

edgebooks Quick Start Guide 4

EMC Documentum Webtop

Version Control Systems

Installing the JDeveloper Subversion VCS extension

Introduction to Source Control Management in OO 10

Click Start > Control Panel > System icon to open System Properties dialog box. Click Advanced > Environment Variables.

ELF WP 2 UML repository instruction

[PRAKTISCHE ASPEKTE DER INFORMATIK WS 13/14]

Use Subversion with GlassFishESB, OpenESB or Java CAPS 6

Modulo II Software Configuration Management - SCM

Automatic promotion and versioning with Oracle Data Integrator 12c

Distributed Version Control with Mercurial and git

Using Internet or Windows Explorer to Upload Your Site

Transcription:

Version Control Using Subversion Version Control Using Subversion 1 / 27

What Is Version Control? Version control is also known as revision control. Version control is provided by a version control system (VCS). VCS: lets you track how your files change over time. lets you back up every version of a file. allows branching and merging lets you revert to earlier versions of a file. lets you work with other people on the same repository of files lets you see who made which changes What kind of files? Text files (including source code, LaTeX, restructuredtext, etc) Usually you will not put binary files under version control. Version Control Using Subversion 2 / 27

Why Subversion? Collaboration Several people can simultaneously contribute to a single document. Documents are not locked! Availability Documents are securely accessible in a single place: the repository. This is the official master copy. History All committed versions of a document are maintained forever Version Control Using Subversion 3 / 27

Collaboration Versions of a document are tracked in a single place, the repository Documents are accessible over the internet (via SSH tunnel) Changes made to the same document by different users are usually merged automatically. Occasionally this must be done manually. Hint: use frequent updates and the UMUTC workflow to minimize manual merging. (Update, Modify, Update, Test, Commit) Version Control Using Subversion 4 / 27

History SVN tracks the entire evolution of a document. additions, deletions, and changes to a document are tracked on a line-by-line basis incremental changes to a document are committed under a new revision number each time the date and time of a new revision is maintained along with the user who committed it Version Control Using Subversion 5 / 27

Using Subversion: Server Side We will not be concerned with the server side. Creating a Repository A class depository has already been created for you. Repository URL has the format: svn checkout https://subversion.american.edu/svn/econ450650s2015 econ450s2015 --username <userid> --password <pw> <userid> substitute your username <userid> substitute your password host The host where the repository resides project The name of the project in the repository Version Control Using Subversion 6 / 27

Working Copy working copy: an ordinary directory on your computer, but SVN adds to special subdirectories named.svn. checkout pick a name for your working directory. svn checkout [URL] [working directory name] This command gets the latest versions files contained in the repository associated with URL (as described in the previous slide). Adding and Removing Files svn add [file] svn delete [file] IMPORTANT: files are not actually added to or deleted from the repository until your next commit. IMPORTANT: do not use spaces in filenames (to keep things simple) Version Control Using Subversion 7 / 27

Keep Your Code Current Use the following sequence when you start working on your code. update your working copy make changes and test them update your working copy test that your working copy still functions commit your changes Version Control Using Subversion 8 / 27

Workflow Follow the UMUTC workflow: update modify update test commit Version Control Using Subversion 9 / 27

Update You can update all files in your working directory to the latest revision in the repository, or just a single file. The update command can also fetch a revision different than the latest revision with the -r flag. svn update svn update [filename] svn update -r n [filename] Here n is the desired revision number. Version Control Using Subversion 10 / 27

Modify Edit your working copy (and save your changes to the file) Add or delete files. Version Control Using Subversion 11 / 27

Update After saving your changes, close the application you are using to edit the file. (This is just to ensure your application does not lock the file and that you end up working on the changed version.) Again run svn update to ensure your changes are compatible. (See the section on Merging.) Open the file in your editor. Version Control Using Subversion 12 / 27

Test if you will commit code that should function, test that it does Version Control Using Subversion 13 / 27

Committing Changes to Existing Files 1 After editing files and saving your changes, but before committing them, do another update (following the steps above) to make sure you changes are compatible with any commits that took place while you were working. 2 commit your changes to the project directory: svn commit message="a commit message" If you omit the message, Subversion will try to start an editor to ask for a commit message. If you also have not set your editor, Subversion will refuse to commit. Version Control Using Subversion 14 / 27

Precaution Make sure (!!) you save your work and close your editor before you update or commit. Version Control Using Subversion 15 / 27

Backing Out of a Commit Suppose you commit code that you should not have: it breaks everything. SVN lets you back out of that commit as follows. 1 extract the old version 2 re-commit the old version E.g., suppose version 314 was the last "good" version of the code. Return your working directory to that version and recommit as follows: svn update -r314 svn commit -message "Discard a stupid commit." Version Control Using Subversion 16 / 27

Merging Suppose you update after you have changed your copy, but the master copy has changed as well. SVN tries to merge the two sets of changes. Usually the changes are to unrelated areas of the file, and this succeeds. If the changes overlap, SVN will merge what it can, and then ask you what to do about the rest. You may choose to accept the repository s changes ( tf, or "theirs-full"). override the repository s changes ( mf, "mine-full") postpone the decisions ( p ) Version Control Using Subversion 17 / 27

Conflicts Postponement is the safest action, but it will mark affected files in a "conflicted" state and insert blocks that look like this: @@ -1 +1,5 @@ def foo(): +<<<<<<<.mine + bar1(); +======= + bar2(); +>>>>>>>.r314 Say this lines are in foo.py. They mean that your copy of foo.py changed your function foo to call a function bar1, whereas someone already changed the repository, in revision 314, in exactly the same place, with foo calling bar2. You will have to resolve this conflict before you can commit your changes. Version Control Using Subversion 18 / 27

Warning You can pick your version, or the repository version, or some other resolution. When you finish, run svn resolved to tell SVN that you have resolved the conflicts. Then you can commit your changes. It is a good idea to run svn diff after an automatic merge. Automatic merging very seldom fails to be correct, but you want to catch any problem however rare. Merging by hand is unpleasant. This can usually be avoided by frequent updating. Merging by hand is particulary unpleasant when a lot of code is involved. This can usually be avoided by frequent committing. If you must make many changes to a file, it is a good idea to warn your teammates, who might have pending modifications that they will want to commit before you act. Version Control Using Subversion 19 / 27

Helpful Information svn status gives information about which files are changed or new. svn log [file] displays commit messages for all revisions, in chronological order, along with the associated revision number. svn annotate [file] shows which users made which changes, line by line with the revision number and associated user name. svn help [command] displays help on any command Version Control Using Subversion 20 / 27

GUI Subversion Clients TortoiseSVN For Windows Subclipse For Eclipse IDE Netbeans contains a Subversion integration module Version Control Using Subversion 21 / 27

Subversion Red Book Version Control with Subversion. CollinsSussman, Ben and Brian W. Fitzpatrick and C. Michael Pilato. http://svnbook.redbean.com/ Version Control Using Subversion 22 / 27

Example: Adding a New Folder This example uses the Windows cmd shell. Mac and Linux users will just use their bash shell instead. open a command shell (on Windows: Start > All Programs > Accessories > Command Prompt) use the cd command to change to the folder holding your working copy http://www.wikihow.com/ Change-Directories-in-Command-Prompt you should always update before making changes, so ask Subversion to update your working copy by entering svn update use Subversion to create your personal directory by entering svn mkdir yournewfoldername finally, ask Subversion to commit your new personal directory to the repository by entering svn commit -m "committing personal directory". note: the string folowing -m is just a message, but Subversion will require you to include a message when you commit. Version Control Using Subversion 23 / 27

TortoiseSVN Windows users may find it useful to use TortoiseSVN. 1 Download TortoiseSVN (32bit or 64bit, depending on your operating system): http://tortoisesvn.net/downloads.html (Do NOT (!!!) use the advertisement links near the top of the page.) 2 Run the TortoiseSVN installer you receive from the download. (You need to have administrator privileges to do this. Unless you turned them off, you should have them, assuming you are on your own computer.) During installation, be sure that you also install the command-line client tools! (The default installation will not include it; you need to add it in the Custom Setup dialog.) Version Control Using Subversion 24 / 27

TortoiseSVN... 1 Create your "working copy" of our repository. This is where you will work on your code. Decide where on your computer you want to keep your code. (Wherever it is now, you will move it to this new place.) For an example, see http://tortoisesvn.net/docs/release/ TortoiseSVN_en/tsvn-dug-checkout.html (Replace the first two lines appropriately.) Click OK. 2 Now add an existing code to your new working copy and commit it. (Just drag your files into the new folder, SVN add them, and SVN commit them. http://tortoisesvn.net/docs/release/tortoisesvn_ en/tsvn-dug-add.html http://tortoisesvn.net/docs/ release/tortoisesvn_en/tsvn-dug-commit.html Version Control Using Subversion 25 / 27

Locking If the likelihood of conflicts becomes large enough for some files, users of a Subversion repository can agree to lock those files while working on them. Here is some background: http://svnbook.red-bean.com/ nightly/en/svn.advanced.locking.html Version Control Using Subversion 26 / 27

Distributed Version Control Subversion uses a centralized model for version control. Distributed version control systems (especially git) have become very popular. Each has advantages and disadvantages. The arguments over the best approach continue: http://www.ianbicking.org/ distributed-vs-centralized-scm.html http://www.developer.com/open/subversion-1. 8-gits-new-features.html Version Control Using Subversion 27 / 27