Using subversion COMP 2400 Prof. Chris GauthierDickey.

Slides:



Advertisements
Similar presentations
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.
Advertisements

 Please sit next to your partner.  If you don’t have a partner, please find one now.
1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
Version Control System (Sub)Version Control (SVN).
1 Using Subversion: Nirav Dave Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology.
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
SOFTWARE REVISION CONTROL WITH SUBVERSION Evan Dickinson & Andy Huang – 9 March 2011.
David Notkin Autumn 2009 CSE303 Lecture 22 Subversion is an open source version control system. Social Implications Friday version control system.
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Version Control using Subversion Albert Young-Sun Kim November 2 nd, 2005 Available at entations/ subversion/
Source Code Revision Control with Subversion Christophe Dupré May 13, 2005 Update KEJ May 10, 2006 Scientific Computation Research Center Rensselaer Polytechnic.
Version Control Systems Phil Pratt-Szeliga Fall 2010.
CS311 – Lecture 08 Outline Subversion (SVN) *All information taken from “SVN Book” O’Reilly Lecture 081CS Operating Systems I.
SubVersioN – the new Central Service at DESY by Marian Gawron.
Version Control Systems and the Subversion Kloimstein Dominik.
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)
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
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.
Unix Command Project Justin Rogers for LS 560 Spring 2015.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
The Design Workshop Introduction to Version Control 1.
Version Control with Subversion Quick Reference of Subversion.
Subversion Code Deployment LifeCycle August 2011.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
Warmup A programmer’s wife tells him, “Would you mind going to the store and picking up a loaf of bread? Also, if they have eggs, get a dozen.” The programmer.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Object-Oriented Software Engineering Using UNIX groups and Subversion Estimated Time: minutes “Unix is user-friendly. It's just very selective about.
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
Chris Onions Getting started with CVS in ATLAS 11 Getting started with CVS in ATLAS Chris Onions (Tutorial based on that of Raúl Ramos Pollán CERN / IT.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
(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.
SENG 403 Tutorial 1 1SENG 403 – Winter Agenda Version Control Basics Subversion Basic actions in Subversion Some examples 2SENG 403 – Winter 2012.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
CSE 219 Computer Science III CVS
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.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
1 CSE306 Operating Systems Projects CVS/SSH tutorial.
Sabriansyah R.A Version Control. The Repository Subversion adalah sistem tersentralisasi untuk informasi sharing Repository adalah pusat penyimpanan data.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Presentation OLOMOLA,Afolabi( ). Update Changes in CSV/SVN.
Version Control and SVN ECE 297. Why Do We Need Version Control?
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
1 CSE 303 Lecture 19 Version control and Subversion ( svn ) slides created by Marty Stepp
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 16 – Version control and git.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
© CGI Group Inc. User Guide Subversion client TortoiseSVN.
Using Subversion for Source Code Control Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative.
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Problem Solving With C++ SVN ( Version Control ) April 2016.
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.
Version Control with Subversion (SVN)
CSE 303 Concepts and Tools for Software Development
Subversion.
Concurrent Version Control
slides borrowed and adapted from Alex Mariakis and CSE 390a
User Guide Subversion client TortoiseSVN
CVS Concurrent Versioning System
Subversion Basics Guide
Prof. Hilfinger CS164 Lecture 4
Presentation transcript:

Using subversion COMP 2400 Prof. Chris GauthierDickey

2 What is subversion? A set of programs that help you keep track of changes to “stuff” code documents A replacement for cvs A set of tools for collaboration so that multiple people can work on the same “stuff”

3 svn Basics At the heart of svn is the repository A centralized store of data, organized like a filesystem tree svn allows you to see previous changes to the repository When was the last time the file contained something I’m looking for?

4 svn has two basic parts: The server: hosts the repository--all changes go through the server The client: an application we use to interact with the server commit changes, get the recent version, search, etc svn keeps track of your local repository through ‘hidden’ files and directories:.svn

5 While the server maintains the main repository, each user has one or more ‘working copies’ These copies hold your own personal set of changes to the files When you commit your changes, the server determines if any conflicts exist You have to fix those conflicts in order to finally commit! The working copy

6 svn Syntax From the command line, we use the ‘svn’ command It’s an svn client that knows how to talk to a server The first command you should learn: svn help This will give you a list of commands you can get help on

7 svn import The 2nd command you must learn: import import copies a set of directories or files to the repository to place them under version control svn import mydev yuser/mydev -m ‘initial import’ yuser/mydev This will recursively copy everything to your personal space in the comp2400 directory under mydev

8 How to start working Note that once you do an ‘svn import,’ you still do not have a working copy! You only import once! Do not modify the stuff under mydev and try to import again You need to learn the 3rd svn command: svn checkout

9 svn checkout will create a working copy of your repository on your machine svn checkout yuser comp yuser This will create a working copy in your current directory You work and edit from inside the working copy Yes, the working copy is a set of directories

10 After you’ve made your changes, you must use the 4th important command svn commit -m ‘lil message about what changes were’ This commits any changes from your working copy to your repository You use -m to specify what you changed: it’s entirely up to you what you say here, but something useful is better than nothing! svn commit

11 svn commit messages You’ll notice when you commit that you get several letters on the left for each file that has been committed U: the file was successfully updated G: You had changes but they were merged successfully with the repository version C: conflict! Uh oh! We’ll get to that later...

12 How to keep working Now that you have a working copy: svn add myfile if myfile is a file, it will be added to the repository on the next commit if myfile is a directory, it will add the directory recursively svn delete myfile If it’s a file, it’s deleted immediately from the working copy and will be deleted in the repository on the next commit If it’s a directory, it will be deleted on the next commit

13 svn copy existingfile newfile copies the existing file to the new file, will be added on commit svn move oldfile newfile renames oldfile to newfile, will occur on commit svn mkdir newdir creates newdir in the working copy and adds it on commit

14 After you’ve made changes, you can use ‘svn status’ to see the status of your working copy You’ll get three columns, the first a letter meaning: A: item is scheduled for addition to the repository C: item has conflicts with the latest version in the repository D: item is scheduled to be deleted from the repository M: item has local changes not in the repository Repository and Working Copy info

15 svn diff If you have an item that is in conflict or that’s modified and you want to examine in details, use ‘svn diff’ svn diff output is a bit odd at first: it only shows the differences between two files A line prefaced with ‘-’ means that it’s been removed A line prefaced with ‘+’ means that you’ve added it

16 svn revert Let’s say that you realized you don’t like the changes you made: Use ‘svn revert myfile’ This will overwrite your working copy with the latest version from the repository Yes, you can just delete it and do ‘svn update’, but that’s more typing!

17 svn conflicts What does svn do when it detects a conflict? It puts 3 unversioned files in your directory: filename.mine: your file as it existed in the working copy filename.rOLDREV: the version in the repository when you checked it out filename.rNEWREV: the version in the repository when you tried to check it in

18 No, you can’t commit! svn won’t let you commit while the file is in conflict You can make the changes by hand: edit the copy in vi You’ll see parts marked >>>>>>.rXXXX which are the latest revision in the repository You get to decide what stays and goes! You can ‘svn revert’ the file if you don’t want your changes

19 svn resolved Once you’ve resolved the conflicts, run ‘svn resolved myfile’ This removes the temporary unversioned files It informs your working directory that your local copy is now the corrected version Finally, ‘svn commit’ to upload your corrected copy to the server

20 Checking the svn History svn log will give you a log of all changes to your repository svn diff will show you the details of a change svn cat will output a particular file to your screen svn list will list the contents of a repository svn info will give you information about the repository, including its location and version #

21 Where to go from here The main subversion website--you can find clients for (almost) all OSes here The online manual for svn--many more details than presented here, if you get stuck, read this!

22 Getting your repository set up htpasswd -n $USER $USER is interpreted by your shell to be your user name You MUST have a Unix account set up already PASSWORD is the password you will use for subversion It’s not the same as your unix password, it can be whatever It’s *NOT* PASSWORD, please don’t make yourself look dumb by using that password ;-)

23 Once you execute that command, it will produce an MD5 hash of your password, which is cryptographically secure You the returned value from that command to and tell him you are in COMP He’s going to create the initial repository for you which will live under: 00/ 00/

24 Exercises Add an unrevisioned directory to your repository Add files and directories to it List it from the repository Delete something from your working copy the correct way (not using rm!)