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



Similar documents
Version Control with Subversion

Revision control systems (RCS) and

CSCB07 Software Design Version Control

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.

Version Control with Subversion and Xcode

CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

Source code management systems

Version Control Systems

Using Subversion in Computer Science

Version Control. Luka Milovanov

Version Control! Scenarios, Working with Git!

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

Version Control with. Ben Morgan

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

Version Control with Subversion

Continuous Integration. CSC 440: Software Engineering Slide #1

MATLAB & Git Versioning: The Very Basics

Version Control. Version Control

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

Version Control with Git

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

Source Control Systems

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

Using SVN to Manage Source RTL

Introducing Xcode Source Control

Using SVN to Manage Source RTL

using version control in system administration

Beginning with SubclipseSVN

Modulo II Software Configuration Management - SCM

Version Control with Git. Kate Hedstrom ARSC, UAF

Data management on HPC platforms

Version Control Script

Introduction to the Git Version Control System

FEEG Applied Programming 3 - Version Control and Git II

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

Xcode Source Management Guide. (Legacy)

Version control with Subversion

Introduction to Version Control

An Introduction to Mercurial Version Control Software

Managing Source Code With Subversion

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

Distributed Version Control with Mercurial and git

Source Code Management/Version Control

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

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

CS 2112 Lab: Version Control

Using Git for Project Management with µvision

Version control with GIT

SVN Starter s Guide Compiled by Pearl Guterman June 2005

Work. MATLAB Source Control Using Git

BlueJ Teamwork Tutorial

Git Basics. Christian Hanser. Institute for Applied Information Processing and Communications Graz University of Technology. 6.

Working with a Version Control System

Advanced Computing Tools for Applied Research Chapter 4. Version control

Managing Software Projects Like a Boss with Subversion and Trac

Theme 1 Software Processes. Software Configuration Management

Version Control with Git. Dylan Nugent

Introduction to Source Control ---

PxPlus Version Control System Using TortoiseSVN. Jane Raymond

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

Introduction to Programming Tools. Anjana & Shankar September,2010

Pragmatic Version Control

Subversion Server for Windows

Version Control with Git. Linux Users Group UT Arlington. Rohit Rawat

MOOSE-Based Application Development on GitLab

Ingeniørh. Version Control also known as Configuration Management

Git - Working with Remote Repositories

Case Study: Access control 1 / 39

Case Studies. Joint software development Mail 1 / 38. Case Studies Joint Software Development. Mailers

Introduc)on to Version Control with Git. Pradeep Sivakumar, PhD Sr. Computa5onal Specialist Research Compu5ng, NUIT

Miguel A. Figueroa Villanueva Xabriel J. Collazo Mojica. ICOM 5047 Capstone Miguel A. Figueroa Villanueva University of Puerto Rico Mayagüez Campus

Version Control with Mercurial and SSH

Derived from Chris Cannam's original at, an.

EAE-MS SCCAPI based Version Control System

Working Copy 1.4 users manual

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

Version Control Using Subversion. 12 May 2013 OSU CSE 1

Using Network Attached Storage with Linux. by Andy Pepperdine

Manual. CollabNet Subversion Connector to HP Quality Center. Version 1.2

Version Control Tools

Fossil Version Control A Users Guide. Jim Schimpf

SVN Setup and Configuration Management

Version Control using Git and Github. Joseph Rivera

Jazz Source Control Best Practices

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

Annoyances with our current source control Can it get more comfortable? Git Appendix. Git vs Subversion. Andrey Kotlarski 13.XII.

Syncro SVN Client 4.2 User Manual. SyncRO Soft Ltd.

Transcription:

CSE 374 Programming Concepts & Tools Laura Campbell (Thanks to Hal Perkins) Winter 2014 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 svn was the most widely used for the last decade and is still common we ll learn basic svn git and mercurial are the hot new thing distributed version control Same core ideas, but more complicated to support independent development and merging of projects 3

The setup There is a svn repository, where files (and all 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 affect 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 remote server Feel free to experiment with private, local repos 6

Getting started Set up a repository (we ll do this for you on hw6; if you do it yourself you get to pick name, location) svnadmin create path/svnrepos Put initial version of project directory in repository (do this once!) 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 and password for future checkin, update, etc. HW6: path to repository server is on cse server 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, fixes bug 31415 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 svn: full documentation is online, free, downloadable http://svnbook.red-bean.com/ Chapters 1 & 2 have most of what you ll need 12