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

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

Software Development I

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

A Gentle Introduction to CMSC311 labs and CVS Or How I learned to use CVS in CMSC311. William Arbaugh September 2, 2004

Revision control. INF5750/ Lecture 2 (Part I)

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

Revision control systems (RCS) and. Subversion

Chapter 3. Revision Control

Git. CSCI 5828: Foundations of Software Engineering Lecture 02a 08/27/2015

Introduction to CVS. Sivan Toledo Tel-Aviv University

Common CVS Command Summary

CVS for Moodle Developers

A CVS Repository for the RNB Group

Version Control Systems

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

Tutorial 2 GitHub Tutorial

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

Version Control. CSC207 Fall 2014

Using CVS 1 of 18. Using CVS. C oncurrent V ersions System - Jeremy Mates

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

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

TDDC88 Lab 4 Software Configuration Management

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

WinCvs Version 1.1. Users Guide. Don Harper

Version Control for Fun and Profit

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

Using CVS to Manage Source RTL

How to version control like a pro: a roadmap to your reproducible & collaborative research

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

Git for Version Control

Common Configuration Management Tasks: How to Do Them with Subversion

Version Control Systems (VCS)

Assumptions. GIT Commands. OS Commands

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

Git. Presenter: Haotao (Eric) Lai Contact:

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

Apache Subversion Tutorial

AccuBridge for IntelliJ IDEA. User s Guide. Version March 2011

Using Git to Manage Source RTL

Introduction to version control. David Rey DREAM

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum

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

Git, the magical version control

Lab #2 Physics 91SI Spring 2013

Introduction to Revision Control

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

Algorithm Engineering

CVS Application. William Jiang

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

Department of Computer Science College of Engineering Boise State University

Lab Exercise Git: A distributed version control system

CSC 2700: Scientific Computing

Project Management. Overview

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

CS108, Stanford Handout #37. Source Control CVS

CVS How-to. 17th July 2003

Using Subversion with LeMANS and MONACO

Software Tools Subversion

Submitting your Work using GIT

Use git rm to remove files from workspace

Git Tutorial. Version: 0.2. Anders Nilsson April 1, 2014

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

Systems Programming Advanced Software Development

Working with CVS in Eclipse

Concurrent Versions System (cvs( cvs) Adviser Date August 31, 2004

Managing Source Code With Subversion

Software Revision Control for MASS. Git Basics, Best Practices

Manage quality processes with Bugzilla

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

A L A TEX-oriented intro to Git

Exercise 3: Adding a file to the master directory

CS 261 Recitation 1 Compiling C on UNIX

SmartCVS Tutorial. Starting the putty Client and Setting Your CVS Password

Construction: version control and system building

Using GitHub to Share with SparkFun a

Pragmatic Version Control

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

VSO. Configuration Management

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

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

Using CVS Repositories with SAS

What is git? Distributed Version Control System (VCS); Created by Linus Torvalds, to help with Linux development;

Object-Oriented Programming: Revision. Revision / Graphics / Subversion. Ewan Klein. Inf1 :: 2008/09

EDGE Tutorial and Sample Project Overview

Construction: version control and system building

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

1/20/13 Git tutorial. Git tutorial. Mike Nolta. file:///users/nolta/github/reveal.js/git.html?print-paper#/ 1/31

Version control with Git.

Laboratorio di Programmazione. Prof. Marco Bertini

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

Version Control Systems

Git. (Why not CVS?... because Git.) Karel Zak Florian Festi Bart Trojanowski December 20, 2007

Version Control: Gitting Started

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

Version Control System - Git. zswu

CS2720 Practical Software Development

Version Control with CVS

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

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

Transcription:

About CVS CVS stands for Concurrent Version Control. It s free, open-source software used by multiple developers to share code, keep track of changes, and keep different versions of a project. it can be (and is) used for large, wide-scale projects, such as the Gnome interface. You ll be using it in your projects to ease the problem of many people working on the same codebase. 1 Version Control - what is it? why is it useful? Allows you to keep a master source tree and have each user check out their own private version of the tree. This allows for: 1. Parallel development. 2. A way to roll back changes. 3. A way to integrate changes from different developers. 4. A way to keep several versions of a codebase on hand. 5. Automated annotations of all changes. I ve placed a directory on nexus in ~brooks/public_html/examples/cvs-code that you can use throughout this tutorial. You should treat this as an existing codebase that you re going to move into CVS, check out into a shadow tree, modify, and check back in. 2 Step 1: set up a repository Create a directory where the master version of your code will reside. This will need to be readable and writable by everyone on the project. If you re using UNIX and have the appropriate privileges, you might consider making a separate group for access. You ll need to set an environment variable to tell CVS where your master directory - you can do this with: setenv CVSROOT /path/to/my/master/directory (for tcsh users) 1

or CVSROOT=/path/to/my/master/directory export CVSROOT (for bash users) Then do: cvs init to set up the appropriate subdirectories under $CVSROOT. You ll probably have a hierarchy of files somewhere that you want to add in to the hierarchy. They could be either third-party software (e.g. java libraries) or code you ve developed yourself. To add these to your repository, do: cvs import <directory> <branchname> <version-name> For example, cvs import./c++code mycode start takes the code in the directory./c++code and adds it to the repository. If you look at the working directory that s been created, you ll see a directory called CVS. This is where CVS does its bookkeeping - keeping track of the CVSROOT variable, what s been checked out, and so on. You shouldn t need to make any changes to these. 3 Step 2: Check out the code you re interested in. The top directory in the code hierarchy is called c++code. To initially create a shadow tree in your own home directory, cd to wherever you want the shadow tree to be and type: cvs checkout c++code This creates the directory myproject and populates it with all the source files. If you just wanted to check out a subset of the tree, you could do something like: cvs checkout c++code/c++code/schedules Now, go ahead and make some changes to the code in your local version of the tree. 4 Step 3: Commit changes. Once you ve made your changes, tested them, and you think they re stable enough to save permanently and share with your group, you want to check them back in so that other people can get them. To do this, if you edited Linear.C in mult-producer/schedules, you would type: 2

cvs commit Linear.C (to commit everything in your current directory and its subtree, do cvs commit ) at this point, an editor opens (which one depends on the value of $CVSEDI- TOR or $EDITOR) and you can add a comment describing the changes/additions that you made. Note: this is not optional! I know commenting is tedious, but it s the best way to inform your team members about changes and figure out why something s broken a week later when you re digging through past revisions. 5 Step 4: add new code to the repository If you have a new file that you want to add to the repository, you can do this by editing it in your working directory, and then adding it to the repository with: cvs add <filename> This schedules the new file for adding. It won t be officially entered into the repository until you commit it. 6 Step 5: Get the latest version of the code. As you re working, you ll want to get the changes that your partners have committed to the repository. You can do this by typing cvs update in your working directory. This will replace all files in the working directory and its subtree with their latest versions (assming they ve changed.) Note: Once you ve created a working directory, be sure you use update and not checkout to get the latest versions of the files. checkout will wipe out all the changes you haven t committed yet! 7 Step 6: Remove obsolete files from the repository. If you have files in the repository that you don t need anymore, you can delete them from the repository by: 1) removing them from your working directory: rm foo.c 2) removing them from CVS: cvs remove foo.c 3) committing the change: cvs commit. As always, nothing happens to the repository until you commit. If you want to completely get rid of a working directory, you can do: cvs release module. This will remove your working directory and note in the log that you ve released it. 3

8 Step 7: Comparing changes You may want to know how your version of a file compares to the one in the repository. (What did I change in here, anyway?) cvs has a diff tool, just like regular UNIX: cvs diff Linear.C will compare the version of Linear.C in your working directory to the one in the code repository. To see who made what changes, do: cvs log Linear.C This will print out a summary of the change log (which everyone commented in. Right? Right!) To see the status of a particular file (the version, whether your working version is up-to-date, when it was last checked in, etc.) you can do: cvs status filename. This is nice if you just want to see whether you re up-to-date without having a merge move everything around on you. (see below) 9 Step 8: Merging Suppose you re editing a file, and you go to update, and the version in the repository has changed. (Your partner has also edited the file.) If the two can t be merged, CVS will give you a warning, save your original file as.#filename.c.versionnumber (e.g..#linear.c.1.4) and mark the changes in the new file, pointing out both your version and the repository version with <<<</>>>>>. CVS will not let you check this file back in (commit it) until you ve resolved these discrepancies. (by hand - it s not that smart.) There are lots of other things you can do with cvs, but these are the basics. For example, you can tag certain versions (alpha/beta releases) you can place the repository on the network, you can read and write-lock files, you can have CVS notify users when a file is checked in, and lots of other stuff. Most of the time, you ll use the commands below. checkout (co) update add remove commit diff export 4

release status There s plenty of information about CVS out there. Two good sources are the man page and the following URL: http://www.cvshome.org/docs/manual http://cvsbook.red-bean.com/ is an online book about CVS and opensource development. This has some nice examples (an essential with CVS!) The GNU manual for CVS is at: http://www.gnu.org/manual/cvs/html_chapter/cvs_toc.html Emacs also has tools called PCL-CVS and VC that serve as a frontend for CVS, if you re an emacs fan. 5