Introduction to Revision Control

Similar documents
An Introduction to Subversion

Revision control systems (RCS) and. Subversion

VSO. Configuration Management

Common Configuration Management Tasks: How to Do Them with Subversion

Revision Control II. - svn

CSE 374 Programming Concepts & Tools. Hal Perkins Winter 2012 Lecture 16 Version control and svn

Using Subversion with LeMANS and MONACO

Version Control System. -- base on Subversion 1.4

Source control with Subversion A user perspective

Subversion Repository Layout

MNXB Working with SVN. Florido Paganelli Lund University Tutorial 2b

Chapter 3. Revision Control

Revision Control. Software Engineering SS 2007

A BASIC UNDERSTANDING OF VERSION CONTROL

Versioning. Jurriaan Hage homepage: Slides stolen from Eelco Dolstra.

Managing Source Code With Subversion

Source Code Management

Version Control Systems (VCS)

Version Control. Kyungbaek Kim. Chonnam National University School of Electronics and Computer Engineering. Original slides from James Brucker

Tools for software development:

Software Tools Subversion

Version Control Systems

Department of Computer Science College of Engineering Boise State University

Using Git to Manage Source RTL

What is Subversion and what does it do?

2/9/2013 LAB OUTLINE INTRODUCTION TO VCS WHY VERSION CONTROL SYSTEM(VCS)? II SENG 371 SOFTWARE EVOLUTION VERSION CONTROL SYSTEMS

Subversion. CS 490MT/5555, Fall 2015, Yongjie Zheng

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

CSE 390 Lecture 9. Version control and Subversion (svn)

2/8/18. Overview. Project Management. The First Law. What is Project Management? What Are These Changes? Software Configuration Management (SCM)

Project Management. Overview

TDDC88 Lab 4 Software Configuration Management

CSC 2700: Scientific Computing

Version Control. Version Control

Subversion. An open source version control system. W. Miah escience Rutherford Appleton Laboratory

Apache Subversion Tutorial

Introduction to version control. David Rey DREAM

Git for Subversion users

Source Control. Comp-206 : Introduction to Software Systems Lecture 21. Alexandre Denault Computer Science McGill University Fall 2006

Subversion FOUR. 4.1 What is Version Control? 4.2 What is Subversion? Types of Version Control SESSION

Version Control. 1 Version Control Systems. Ken Bloom. Linux User Group of Davis March 1, 2005

[Software Development] Development Tools. Davide Balzarotti. Eurecom Sophia Antipolis, France

CS2720 Practical Software Development

Revision Control and GIT

Working with GIT. Florido Paganelli Lund University MNXB Florido Paganelli MNXB Working with git 1/47

Software Development. Hack, hack, hack, hack, hack. Sorta works. Main.c. COMP s1

Home Page. Title Page. Contents. Page 1 of 17. Version Control. Go Back. Ken Bloom. Full Screen. Linux User Group of Davis March 1, Close.

Version Control. CSC207 Fall 2014

CSE 160: Introduction to Parallel Computation

CVS. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 21

Revision control. INF5750/ Lecture 2 (Part I)

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

Introduction to Version Control

Subversion Branching and Merging. Jan Skalický

Version control CSE 403

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

CS 320 Introduction to Software Engineering Spring February 06, 2017

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

CS 390 Software Engineering Lecture 3 Configuration Management

Manage quality processes with Bugzilla

February 2 nd Jean Parpaillon

Importing Files and Directories $ svnadmin create \

Version Control for Fun and Profit

A Short Introduction to Subversion

GIT TUTORIAL. Creative Software Architectures for Collaborative Projects CS 130 Donald J. Patterson

Version control. Michael Tsai 2012/4/10

A Comparative Study on Different Version Control System

Managing a WordPress 2.6 installation with Subversion. Sam Bauers - Automattic

Git Tutorial. André Sailer. ILD Technical Meeting April 24, 2017 CERN-EP-LCD. ILD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 1/36

Push up your code next generation version control with (E)Git

If you are new to version control systems and are wondering where to start, read the article Version Control and Altium Designer.

About CVS. 1 Version Control - what is it? why is it useful?

Part I Part 1 Version Control Systems (VCSs)

Fundamentals of Git 1

M E R C U R I A L (The Source Control Management)

Version Control Systems

Programming in the large. Lecture 22: Configuration Management. Agenda for today. Bertrand Meyer. Bernd Schoeller

Version Control Systems

Using CVS to Manage Source RTL

Construction: version control and system building

Branches in Subversion, Debugging, scmbug

Using Subversion for Source Code Control

Version Control System GIT

Git. Presenter: Haotao (Eric) Lai Contact:

Exercise 3: Adding a file to the master directory

Apache Subversion (SVN)

CSCI 4152/6509 Natural Language Processing. Lab 1: FCS Computing Environment

Table of Contents: Tortoise SVN is used as a source control for FpML.

Assembla & TortoiseSVN

Yinghui Wang

Implement an ADT while using Subversion

Computer Science Design I Version Control with Git

Systems Software. Recitation 1: Intro & Revision Control. Quite different from 213. Our Philosophy. Partly-free lunch

Part I Part 1 Version Control Systems (VCSs)

Version control CSE 403

Version Control Systems (Part 1)

1 Version management tools as a basis for integrating Product Derivation and Software Product Families

Apache Subversion (SVN)

Subversion. Network Monitoring & Management

Transcription:

Introduction to Revision Control Henrik Thostrup Jensen September 19 th 2007 Last updated: September 19, 2007 1

Todays Agenda Revision Control Why is it good for? What is it? Exercises I will show the basics Fetch slides and work from them Will probably not take four hours 2

Why should I use revision control Provides a structured way for working together on a set of files Also beneficial when working alone No lost changes Provides history of changes To see what went wrong 3

Revision Control 101 Central concept is a repository A database which stores the current content and all changes made to the content. Old revisions can brought out and differences viewed. Users checkout copies of the repository and commit back changes. Users must update their copy of the repository. 4

Subversion An open source revision control system Has mostly replaced CVS Works quite well Well documented Has free online book (also available in paper version) Available at: http://svnbook.red-bean.com/ Very well written Build in help: svn help and svn help command Uses a centralized repository Easier to grasp than distributed version control 5

Tortoise SVN Graphical client for Windows Can be used instead of the command line tool Can be downloaded from: http://tortoisesvn.tigris.org/ 6

Exercises First: Have a terminal on the server available This is needed to create the repository The command line tool is used in the exercises A graphical client can of course also be used 7

Creating a Repository Creating a repository using the svnadmin tool. Do the following in a terminal: svnadmin create /SVN test This creates a repository in a directory named SVN test located in your home directory The URL to your repository is: svn+ssh://marge.cs.aau.dk/user/username /SVN test The directory should be considered a black box Only in emergencies should you change anything manually in this directory. 8

Checking out a copy Before working, a copy of the repository must be created. This is done with the following command (one line): svn checkout svn+ssh://homer.cs.aau.dk/user/username /SVN test svncheckout The copy will be in the directory svncheckout. Remember: You are working on a copy. Changes will only be visible to others after you commit. 9

Putting data in the Repository Subversion only tracks files which you ask it to track. To add a file to the repository: svn add filename The file is only added to your local copy. To update the repository, you must commit the changes: svn commit The commit may fail if a conflict is detected. Note: It is also possible to import entire directory trees directly into the repository using the command. svn import 10

Viewing changes Sometimes is nice to see what have been changed. svn status provides a high level view of changes. Note: Only local changes are displayed. File diffs can be seen with: svn diff If you are happy with the changes, you can commit. If not, you can revert changes: svn revert filename This will roll back the file to your latest checkout Careful! This can delete your work 11

Moving, Deleting, and Copying To rename a file: svn move oldname newname To delete a file: svn delete filename Note: History is still kept for the deleted file, so it can be restored later. To copy a file: svn copy filename filecopy Copying may seem strange, but it is useful when splitting a file, as history will exist for both files, and the split itself is explicit. 12

Getting Changes Other people often change the content of the repository To get these changes, you must update your copy: svn update This will update your copy to the latest revision Creating a repository, adding files, committing changes and receiving changes are the most common and necessary operations. Most persons only use these and get along fine. 13

Conflicts When updating, a merge conflict can occur Conflicts happen when Subversion cannot merge a change you have made to a file and a change that has been made to the same file in the repository. Conflicts are resolved manually by editing the file After fixing the conflict, mark it resolved with svn resolved filename Conflicts can be prevented by having people work on different files. Avoid huge commits, they increase the chance of conflicts and are harder to merge. With a bit of thought, conflicts rarely occurs. 14

Working with revisions Subversion allows you to explore the history of a repository. Checking out an old revision: svn checkout repository url -r revision Also possible to specify dates. See the build-in help or the book. Viewing changes between different versions: svn diff -r:rev1:rev2 This will show the differences between two revisions You can specify filename to see changes made on a certain file (also works on subtrees). 15

Trunk, Tags, and Branches A Subversion repository is usually split into a trunk, tags and branches. Trunk is current development (or mainline). Tags are marked revisions e.g., releases, or known good versions. Branches are for development happening in parallel with trunk, but does not disturb trunk. Tags and branches are often not necessary in smaller projects, but can be still be useful. The free Subversion book explains tags and branches very well. 16

Setting up the Repository - Again When using trunk, tags and branches, the repository must be setup in a slightly different way. 1 Create a repository using svnadmin (as before) 2 Checkout the repository and add the directories trunk, tags, branches, and commit. 3 Re-checkout the trunk directory and work with that as main development. Tags and branches are explained in the following slides. 17

Tags In Subversion tagging is implemented using copying Other revision control systems use other mechanisms A tag can be done like this (one command): svn copy svn+ssh://homer.cs.aau.dk/repopath /trunk svn+ssh://homer.cs.aau.dk/repopath /tags/mytag -m "Tagging trunk to MyTag" Then the current trunk will be available at tags/mytag even after changes have been made. Note: The repository does not make a complete copy, as this is not needed. Tagging is very cheap. 18

Branches A branch is basically a copy of trunk, in which development can be done without disturbing trunk. Good for longer development tasks such as replacing an entire subsystem or similar. Working with branches is too complicated to be covered in a few slides. Check out the Subversion book, which covers the topic in a very understandable way. 19

A final note on working with revision control Avoid huge commits Difficult to see what has actually changed They make merging difficult Many editors also integrate with Subversion Yes, there is a learning curve, and you might have to change the way you work. But it is worth it. All serious software projects use it for tracking code. You should too (and for L A TEXas well). 20