Introduction to Version Control

Slides:



Advertisements
Similar presentations
Week 2 DUE This Week: Safety Form and Model Release DUE Next Week: Project Timelines and Website Notebooks Lab Access SharePoint Usage Subversion Software.
Advertisements

Let Use SVN(Subversion) Interaction Lab. Hyo-Geun Ahn
Version Control 1.  Version control (or revision control) is the term for the management of source files, and all of the intermediate stages as development.
Software Configuration Management Donna Albino LIS489, December 3, 2014.
Summer of Code (SOC) Presentation Fred R McClurg Girish H Mhatre Version Control Overview.
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
Version Control What it is and why you want it. What is Version Control? A system that manages changes to documents, files, or any other stored information.
Concepts of Version Control A Technology-Independent View.
Version Control using Subversion Albert Young-Sun Kim November 2 nd, 2005 Available at entations/ subversion/
CVS Selim Çıracı Ahmet Kara Metin Tekkalmaz. CVS – Open Source Version Control System Outline What are Version Control Systems? And why do we need them?
Version Control Systems Phil Pratt-Szeliga Fall 2010.
CS 501 : An Introduction to SCM & GForge An Introduction to SCM & GForge Lin Guo
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Microsoft Visual Source Safe 6.01 Microsoft Visual Source Safe (MVSS) Presented By: Rachel Espinoza.
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
1 CMPT 275 Software Engineering Revision Control.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
SubVersioN – the new Central Service at DESY by Marian Gawron.
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
Version control Using Git 1Version control, using Git.
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.
Source Control Repositories for Team Collaboration: SVN, TFS, Git Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
1 Topics for this Lecture Software maintenance in general Source control systems (intro to svn)
Source Control Repositories for Team Collaboration: SVN, TFS, Git.
Revision Control and Issue Tracking Andrew Watkins.
Version Control with Subversion Quick Reference of Subversion.
With Mercurial and Progress.   Introduction  What is version control ?  Why use version control ?  Centralised vs. Distributed  Why Mercurial ?
1 Lecture 19 Configuration Management Software Engineering.
Source Control Systems SVN, Git, GitHub SoftUni Team Technical Trainers Software University
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
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.
Version Control. What is it? Software to help keep track of changes made to files Tracks the history of your work Helps you collaborate with others.
Version control Using Git Version control, using Git1.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Introduction to Version Control SE-2030 Dr. Rob Hasker 1 Based on material at and slides written.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Computer Science and Engineering The Ohio State University  Widely used, especially in the opensource community, to track all changes to a project and.
1 Brief Introduction to Revision Control Ric Holt.
Version Control Systems. Version Control Manage changes to software code – Preserve history – Facilitate multiple users / versions.
Version Control System
Presentation OLOMOLA,Afolabi( ). Update Changes in CSV/SVN.
(1) Introduction to Continuous Integration Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
(1) Introduction to Continuous Integration Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
SECTION 1: CODE REASONING + VERSION CONTROL slides borrowed and adapted from Alex Mariakis and CSE 390a Justin Bare & Deric Pang.
TEAM FOUNDATION VERSION CONTROL AN OVERVIEW AND WALKTHROUGH By: Michael Mallar.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Source Control Repositories for Enabling Team Working Doncho Minkov Telerik Corporation
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
DIGITAL REPOSITORIES CGDD Job Description… Senior Tools Programmer – pulled August 4 th, 2011 from Gamasutra.
Git workflows: using multiple branches for parallel development SE-2800 Dr. Mark L. Hornick 1.
Source Control Dr. Scott Schaefer. Version Control Systems Allow for maintenance and archiving of multiple versions of code / other files Designed for.
CompSci 230 Software Construction
Source Control Systems
Information Systems and Network Engineering Laboratory II
Git and GitHub primer.
Version Control with Subversion
LECTURE 2: Software Configuration Management
Version control, using Git
CISC/CMPE320 - Prof. McLeod
Concurrent Version Control
Version Control System
Source Code Management
LECTURE 3: Software Configuration Management
Git CS Fall 2018.
Systems Analysis and Design I
Presentation transcript:

Introduction to Version Control Based on material at http://svnbook.red-bean.com/ and git-scm.com/book SE-2030 Dr. Mark L. Hornick

The stages of developing a software application Requirements Analysis High-level Design [Plan (SE2800)] Low-level Design Implementation Unit Test (SE2832) Integration System Test (SE3800) Deploy (SDL) Maintain (SDL)

In many cases, multiple projects run concurrently New features are typically being added to the next version While at the same time, defects need to be corrected in existing releases You will do this more in SDL SE-2030 Dr. Mark L. Hornick

On a single project, a team of software engineers work together toward a release All team members work on the same code and develop their respective parts An engineer may be responsible for an entire class Or just a few methods within a particular class SE-2030 Dr. Mark L. Hornick

Files have to be shared among developers on a team project Shared files can be kept in some type of Repository where they can be accessed and worked on by multiple individuals Harry and Sally get their own respective local Working Copies of the Master File in the Repository SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

What might you use for a Repository? Would any of these work? USB/SD drive Private network drive E.g. shared “X:” drive Cloud drive Google drive Dropbox iCloud SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

Sharing files can lead to big problems… Adds some method Modifies some other method SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

The problem to avoid: Harry’s changes are still held locally… SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

Harry’s changes are lost ‘’ Harry’s local file gets overwritten with Sally’s latest changes. ‘’ SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

The Issue: Effective management of software artifacts, especially code Some acronyms: SCM – Source Code Management SCCM – Source Code Configuration Management RCS – Revision Control System VCS – Version Control System DVCS - Distributed Version Control Systems SE-2030 Dr. Mark L. Hornick

Revision/Version History might help …but USB/SD, private network drives do not maintain revision history Cloud drives (e.g. Google Drive, Dropbox, iCould/Time Machine) maintain a (limited) history of the various revisions of a file Google Drive: keeps last 100 revisions or last 30 days Supported in “Classic” mode only – going away? IF you detect a collision, you can manually merge the differences and resynchronize your work Might be workable for two people – what about 5 or 10? SE-2030 Dr. Mark L. Hornick

Any other disadvantages to Google Drive/Dropbox/iCloud Security? Support (bug fixes and new features)? Ownership of stored information? Cost? Ease of Use? Acceptance? SE-2030 Dr. Mark L. Hornick

Special-purpose Revision Control Systems have been around a lot longer than Google Drive or Dropbox SCCS, 1972 (IBM) RCS, 1982 (Unix) SourceSafe 1995 (Microsoft) CVS, 1986 (multi-platform) SVN, 2000 (multi-platform) Git and Mercurial, 2005 (multi-platform) The way these work has evolved over the years SE-2030 Dr. Mark L. Hornick

Features of version control systems All changes to a file are tracked Version histories show who, what, when Changes can be reverted (rewound to any earlier version) Changes between revisions are easy to identify SE-2030 Dr. Mark L. Hornick

The Lock-Modify-Unlock solution Early systems followed this model (RCS, SourceSafe) Sally must wait until Harry releases the lock, although she can retrieve a “readonly” version of the file in the meantime. SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

Lock-Modify-Unlock only allows a single user to edit the file at a time Sally must continually poll the system to see if the file has been unlocked, or Harry needs to tell her when he unlocks it. SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

Lock-Modify-Unlock has certain drawbacks: Harry has to remember to release his lock before Sally (or anyone else) can acquire the lock in order to edit Sally has to wait for Harry to finish before editing (editing must be done sequentially) Harry might be adding some new methods (takes a long time) Harry might forget to release the lock before going home (or on vacation!) SE-2030 Dr. Mark L. Hornick

The Copy-Modify-Merge solution allows concurrent editing CVS, SVN use this model Harry adds new methods Sally adds comments SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

The Repository recognizes conflicts Harry is prevented from writing SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

Conflicting versions of the files are merged Conflicts are automatically resolved in many cases using robust merging algorithms. However, manual merging is sometimes necessary and can introduce errors. SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

The Repository keeps both users synchronized Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

Copy-Modify-Merge is generally easy to use and manage Users can work in parallel Most of the time, concurrent changes don’t overlap People generally don’t edit exactly the same code simultaneously, so merging is done automatically in many cases Amount of time spent resolving conflicts is nearly always less than the time that would be spent waiting for a lock to be released SE-2030 Dr. Mark L. Hornick

Is Lock-Modify-Unlock ever needed anymore? When two or more people need to work on the same file, the simultaneous changes may not be mergable in all cases: MS Office documents Image documents Other binary files SE-2030 Dr. Mark L. Hornick

Subversion is an open-source version control system that is available and still supported for many platforms Windows Mac Linux Many current open-source projects use Subversion to maintain source code control http://subversion.tigris.org/ Latest release 8/2014 MSOE still maintains Subversion on a linux server SE-2030 Dr. Mark L. Hornick

Subversion’s main drawback is the centralized nature of the Repository A repository is typically hosted on a server. Version history is on the server, not on your local PC If the server or network become unavailable, everyone gets stuck with the working copy they have. SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/

Distributed Version Control A “remote master” repository is typically hosted on a server. Clones of the remote repository are maintained on each user’s computer If the server goes down, users can continue sharing code (provided they can connect over a network) by synch’ing to each others’ repositories If the network is unavailable, users can continue reading & writing to their own local repository – synch’ing with others later Git and Mercurial use this model SE-2030 Dr. Mark L. Hornick Image: http://git-scm.com/book/

Merging in a DVCS, part 1 1. Initially, both users’ repositories are synch’d to the remote master; All files are identical. 2. Both users edit the same file, and their local repositories reflect their changes SE-2030 Dr. Mark L. Hornick

Merging in a DVCS, part 2 4. User B attempts to “push” his repository to the remote to synch; this fails due to User A’s earlier push. Remote does not change. 3. User A “pushes” her repository to the remote master to synch; this succeeds. SE-2030 Dr. Mark L. Hornick

Merging in a DVCS, part 3 5. User B “pulls” User A’s updates from the remote master, merging A and B together. Merging is automatic with some exceptions. 6. User B “pushes” his repository to the remote to synch; this now succeeds SE-2030 Dr. Mark L. Hornick

Merging in a DVCS, part 4 7. User B “pulls” from the remote, and everyone is in synch again. SE-2030 Dr. Mark L. Hornick

Repositories can also manage and track differences between parallel revisions of a document Typically, a software product will undergo parallel development on different branches (e.g. for new/future features) while primary development takes place on the main (master) branch You will learn how to use branching in SE2800; we will not use it in SE2030 SE-2030 Dr. Mark L. Hornick Image: http://svnbook.red-bean.com/