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

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

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

Version Control. CSC207 Fall 2014

Department of Computer Science College of Engineering Boise State University

Chapter 3. Revision Control

Introduction to Revision Control

Using Subversion with LeMANS and MONACO

Revision control systems (RCS) and. Subversion

Revision control. INF5750/ Lecture 2 (Part I)

A Short Introduction to Subversion

Version Control Systems (Part 1)

Common Configuration Management Tasks: How to Do Them with Subversion

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

Source control with Subversion A user perspective

CS2720 Practical Software Development

Software Tools Subversion

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

And check out a copy of your group's source tree, where N is your one-digit group number and user is your rss username

Version Control System. -- base on Subversion 1.4

Software Development I

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

Introduction to Version Control

Version Control Systems (VCS)

Version Control Systems: Overview

Version Control for Fun and Profit

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

Revision Control and GIT

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

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

Managing Source Code With Subversion

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

Project Management. Overview

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

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.

What is Subversion and what does it do?

Portions adapted from A Visual Guide to Version Control. Introduction to CVS

Version Control Systems

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

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

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

Workshop: High-performance computing for economists

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

Subversion Repository Layout

TDDC88 Lab 4 Software Configuration Management

Introduction to CVS. Sivan Toledo Tel-Aviv University

Computer Labs: Version Control with Subversion

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

Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

Revision Control II. - svn

Revision Control. An Introduction Using Git 1/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.

Submitting your Work using GIT

Introduction to version control. David Rey DREAM

Version Control. Software Carpentry Github s Hello World Git For Ages 4 And Up You need source code control now

Introduction to Git and Github

Source Code Management

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

A Practical Introduction to Version Control Systems

9 and 11-Jan CSCI 4152/6509 Natural Language Processing Lab 1: FCS Computing Environment, SVN Tutorial. FCS Computing Environment, SVN Tutorial

Introduction to Version Control

COSC345 Software Engineering. Version Control

Exercise 3: Adding a file to the master directory

VSO. Configuration Management

1. Git. Robert Snapp

Computer Labs: Version Control with Subversion

Subversion was not there a minute ago. Then I went through a couple of menus and eventually it showed up. Why is it there sometimes and sometimes not?

Using Git to Manage Source RTL

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

Subversion. Network Monitoring & Management

Version Control. Version Control

Version Control Systems. Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

CS480. Compilers Eclipse, SVN, Makefile examples


SECTION 1: CODE REASONING + VERSION CONTROL + ECLIPSE

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

Using CVS to Manage Source RTL

Fundamentals of Git 1

Construction: version control and system building

CS 378: Autonomous Intelligent Robotics (FRI) Dr. Todd Hester

Using Subversion for Source Code Control

Welcome! Virtual tutorial starts at 15:00 GMT. Please leave feedback afterwards at:

Version control with RCS and CVS An introduction. Markus Bjartveit Krüger

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

CSC 2700: Scientific Computing

Laboratorio di Programmazione. Prof. Marco Bertini

Systems Programming Advanced Software Development

Version Control with GIT

2 Initialize a git repository on your machine, add a README file, commit and push

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

A BASIC UNDERSTANDING OF VERSION CONTROL

AMath 483/583 Lecture 2. Notes: Notes: Homework #1. Class Virtual Machine. Notes: Outline:

AMath 483/583 Lecture 2

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

Version Control with GIT: an introduction

Task-Oriented Solutions to Over 175 Common Problems. Covers. Eclipse 3.0. Eclipse CookbookTM. Steve Holzner

Part I Part 1 Version Control Systems (VCSs)

Distributed Version Control

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

Transcription:

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

Where we are Learning tools and concepts relevant to multi-file, multi-person, multi-platform, multi-month projects Today: Managing source code Reliable backup of hard-to-replace information (i.e., sources) Tools for managing concurrent and potentially conflicting changes from multiple people Ability to retrieve previous versions Note: None of this has anything to do with code. Like make, version-control systems are typically not language-specific. Many people use version control systems for everything they do (code, papers, slides, letters, drawings, pictures,... ) Traditional systems were best at text files (comparing differences, etc.); newer ones work fine with others too But be sure to check before storing videos & other media 2

Version-control systems There are plenty: scss (historical), rcs (mostly historical), cvs (built on top of rcs), subversion, git (much more distributed), mercurial, sourcesafe, The terminology and commands aren t particularly standard, but once you know one, the others aren t difficult the basic concepts are the same cvs had the biggest mind-share for about a decade (particularly in the open-source community) svn improves on several cvs shortcomings and is widely used we ll learn basic svn git and mercurial are the hot new thing distributed version control but core ideas are the same 3

The setup There is a svn repository, where files (and past versions) are reliably stored. Hopefully the repository files are backed up, but that s not svn s problem You do not edit files in the repository directly. Instead: You check-out a working copy and edit it You commit changes back to the repository You use the svn program to perform any operations that need the repository One repository may hold many projects. A subversion repository is just a database of projects and files. Looks like a filesystem tree of project directories 4

Tasks Learn the common cases; look up the uncommon ones. In a production shop Create a repository (rare every few years) a new project (infrequent once or twice a year) a working copy of a project (every few weeks or months?) Working with files Get updates, add or remove files, commit changes to repository (daily) Check version history, differences (as needed) Branches, locks, watches, others (every now and then) Basic command structure is the same for all svn svn-options cmd cmd-options files 5

Repository access A repository can be: Local: specify repository directory root via a regular file path name url (file:///path...) Remote: lots of remote protocols supported (ssh, https, ) depending on repository configuration Specify user-id and machine Usually need svn and ssh installed locally Need authentication (ssh password or other) HW6 uses https access to remove server Can experiment locally also 6

Getting started Set up a repository (your choice of name, location; we ll do this for you on hw6) svnadmin create path/svnrepos Put initial version of project directory in repository svn import projdir svn://path/svnrepos/proj -m msg Commands that update a repository require a message (msg) that should briefly document the change Once a project is imported, never use the original directory again (never! We really mean that!) Path depends on kind of access (local/remote) Check out a copy of the project to a working directory cd working-directory svn checkout svn://path/svnrepos/proj proj Working directory remembers repository location for future checkin, update, etc. HW6: path to repository server is different see writeup 7

File manipulation Add files with svn add (won t be in repository if you don t) Bring local working copy up to date with svn update (get changed files from repository) Commit local changes with svn commit Any number of files including subdirectories recursively if no filename specified Files not actually added to repository until commit Commit messages are mandatory -m short message -F filename-containing-message Else pop up editor if EDITOR or VISUAL environment variable is set Else complain 8

Some examples Update local working directory to match repository svn update Make changes (do via svn, not mv, cp, so repository will also change on commit) svn add file.c svn move oldfile.c newfile.c svn delete obsoletefile Commit changes svn commit -m this is much better Examine your changes svn status svn diff file.c svn revert file.c 9

Conflicts This all works great if there is one working-copy. With multiple working-copies there can be conflicts: 1. Your working-copy checks out version 17 of foo 2. You edit foo 3. Somebody else commits a new version (18) of foo Subversion tries to merge changes automatically; if it can t you must resolve the conflict. If svn commit fails: Do svn update to get repository version and attempt merge G means the automatic merge succeeded C means you have to resolve the conflict Merging is line-based, which is why svn is better for text files Conflicts indicated in the working-copy file (search for <<<<<<) Recent versions of svn handle more of this automatically or interactively 10

svn gotchas Do not forget to add files or your group members will be very unhappy. Keep in the repository exactly (and only) what you need to build the application! Yes: foo.c foo.h Makefile No: foo.o a.out You don t want versions of.o files etc.: Replaceable things have no value They change a lot when.c files change a little Developers on other machines can t use them 11

Summary Another tool for letting the computer do what it s good at: Much better than manually emailing files, adding dates to filenames, etc. Managing versions, storing the differences Keeping source-code safe Preventing concurrent access, detecting conflicts. 12