Version Control Systems (Part 1)

Similar documents
Version Control Systems: Overview

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

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

Software Development I

1. Which of these Git client commands creates a copy of the repository and a working directory in the client s workspace. (Choose one.

Visualizing Git Workflows. A visual guide to 539 workflows

Version Control Systems (VCS)

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

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

Revision control. INF5750/ Lecture 2 (Part I)

Distributed Version Control

Revision control systems (RCS) and. Subversion

Ingegneria del Software Corso di Laurea in Informatica per il Management (D)VCS. Davide Rossi Dipartimento di Informatica Università di Bologna

Version Control. So#ware Quality Quality Audit and Cer2fica2on. Master in Computer Engineering. Roberto García

Revision Control. How can 4. Slides #4 CMPT 276 Dr. B. Fraser. Local Topology Simplified. Git Basics. Revision Control:

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

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

A Practical Introduction to Version Control Systems

Weak Consistency and Disconnected Operation in git. Raymond Cheng

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

Topics covered. Introduction to Git Git workflows Git key concepts Hands on session Branching models. Git 2

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


Project Management. Overview

Git for Subversion users

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

Laboratorio di Programmazione. Prof. Marco Bertini

TDDC88 Lab 4 Software Configuration Management

Software configuration management

Git tutorial. Katie Osterried C2SM. October 22, 2015

Outline The three W s Overview of gits structure Using git Final stuff. Git. A fast distributed revision control system

Revision Control. An Introduction Using Git 1/15

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

GUIDE TO MAKE A REAL CONTRIBUTION TO AN OPEN SOURCE PROJECT 1. 1

Version control CSE 403

b. Developing multiple versions of a software project in parallel

Git for Version Control

Source control with Subversion A user perspective

CSC 2700: Scientific Computing

Git. A fast distributed revision control system. Nils Moschüring PhD Student (LMU)

Introduction to Git and Github

CS 320 Introduction to Software Engineering Spring February 06, 2017

Department of Computer Science College of Engineering Boise State University

An Introduction to Subversion

Version control with Git.

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

CSE 160: Introduction to Parallel Computation

Version Control System. -- base on Subversion 1.4

COSC345 Software Engineering. Version Control

Revision Control and GIT

Version Control with Git ME 461 Fall 2018

Software Tools Subversion

Computer Science Design I Version Control with Git

Version Control: Gitting Started

git and the virtue of version control ECE /2/2015

Fundamentals of Git 1

Version control CSE 403

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

Version Control Systems

Version Control Systems

Version Control Systems

Using Git to Manage Source RTL

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

Version Control Systems

CESSDA Expert Seminar 13 & 14 September 2016 Prague, Czech Republic

Part I Part 1 Version Control Systems (VCSs)

Tools for software development:

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

SECTION 1: CODE REASONING + VERSION CONTROL

SECTION 1: CODE REASONING + VERSION CONTROL

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

What is Subversion and what does it do?

Lecture 6 Remotes. Sign in on the attendance sheet!

Version Control for Fun and Profit

Human Version Control

A quick (and maybe practical) guide to Git and version control. By Jay Johnson

CSE 331 Software Design & Implementation

Using git to download and update BOUT++

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

KTH Royal Institute of Technology SEMINAR 2-29 March Simone Stefani -

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng

Version Control. Version Control. Human Version Control. Version Control Systems

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

Using GitHub and SourceTree to work with DITA TC repositories

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

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

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

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

CS2720 Practical Software Development

A BASIC UNDERSTANDING OF VERSION CONTROL

CSE 391 Lecture 9. Version control with Git

Version Control. CSC207 Fall 2014

INET

Version Control. Collaborating with git. Tim Frasier

Week 5. CS 400 Programming III

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

Overview. 1. Install git and create a Github account 2. What is git? 3. How does git work? 4. What is GitHub? 5. Quick example using git and GitHub

Version Control System - Git. zswu

Transcription:

i i Systems and Internet Infrastructure Security Institute for Networking and Security Research Department of Computer Science and Engineering Pennsylvania State University, University Park, PA Version Control Systems (Part 1) Devin J. Pohly <djpohly@cse.psu.edu> Page 1

Version control systems A version control system is a system for keeping track of the changes made to a document (or collection of documents) over time Any kind of document... Resumes Source code TPS reports Page 2

Why? It s a time machine! Look at old versions Never lose anything Revert your mistakes Code fearlessly! Collaboration Work in parallel Merge changes Social coding Page 3

A word about words These terms all refer to the same thing: Version control system Revision control system Source code/control management VCS/RCS/SCM For this lecture: version control and VCS Page 4

Basic concepts Revision: one meaningful change or set of changes Repository: where all of the revisions are stored Working copy: copy of one revision, where the user makes changes Check out: get a working copy from Check in/commit: add a new revision to Page 5

Basic concepts Branches: parallel lines of development Trunk/master: main development branch Tip/head: latest revision on a branch Tag: special name given to an important revision Often used for numbered releases like v4.0 Page 6

The first generation Local VCSes 1970s and 80s SCCS, RCS Repository stored in a shared local directory User must lock a file before making changes Lock-edit-unlock model Page 7

RCS usage Extremely simple Check out (read-only) rcs co Check out and lock rcs co -l Check in and commit changes rcs ci Page 8

How RCS works Repository 1.1 1.12 1.1 1.5 1.1 1.50 Each file has its own in the RCS directory, in which all of that file s revisions are stored Page 9

How RCS works rcs co rcs co Repository 1.1 1.12 1.5 1.1 1.5 1.5 1.1 1.50 Anyone can check out a read-only working copy of a file. Page 10

How RCS works rcs co -l Repository 1.12 1.1 1.12 1.5 1.1 1.5 1.5 1.1 1.50 If wants to make changes to, she must lock the file for writing when she checks it out. Page 11

How RCS works vim rcs co -l Repository 1.12 1.1 1.12 1.5 1.1 1.5 1.5 1.1 1.50 Once has locked, nobody else may lock it. can now safely edit her local copy of the file. Page 12

How RCS works vim rcs ci rcs ci Repository 1.12 1.1 1.12 1.5 1.1 1.5 1.5 1.1 1.50 You can only commit changes to a file if you hold the lock. Committing checks in s changes as a new revision, then unlocks the file so others can lock it. Page 13

How RCS works Repository 1.1 1.13 1.5 1.1 1.5 1.5 1.1 1.50 When commits her modified, the creates the new revision number 1.13. Page 14

The second generation Centralized VCSes 1980s to 2000s CVS, Subversion (SVN) Still widely used Repository on a server with many clients Copy-modify-merge model Page 15

How Subversion works Repository 1 56 Spot the differences! Page 16

How Subversion works Repository 1 56 Files are stored in one rather than individual ones. Repository and users can all be on different hosts. Page 17

How Subversion works svn checkout URL svn checkout URL Repository 1 56 Checkout does the same thing: gets a working copy of the latest revision (which now contains all the files) from the. You don t have to lock files to change them. Page 18

How Subversion works vim vim svn commit Repository 1 56 If modifies some files and commits her changes... Page 19

How Subversion works Repository 1 57... a new revision of the (r57) is created. Page 20

How Subversion works vim svn commit Repository 1 57 If makes changes that don t overlap with s, Subversion can merge them automatically. This is what happens most of the time. Page 21

How Subversion works vim svn commit Repository 1 57 If Subversion can t merge the changes automatically, it notifies that there is a merge conflict. Page 22

How Subversion works svn update vim svn commit Repository 1 57 So updates his with s changes, merges them with his, and tries to commit again. Page 23

How Subversion works Repository 1 58 s commit succeeds this time, creating revision 58, which is then stored in the. Page 24

Commit graphs SVN 56 57 58 By convention, the arrow points from the child revision to the parent revision. Every branch in Subversion or RCS has an entirely linear commit graph. (Branches are linearized when you merge them.) Page 25

The third generation Distributed VCSes 2000s to today Bazaar, Git, Mercurial Seeing widespread use Everyone has a full Highly collaborative Linux development GitHub and other social coding sites Page 26

Sharing your revisions When you commit your changes, the revision is stored in your local All communication is between repositories You push local revisions to a remote... and you pull revisions from a remote into the local one. Page 27

How Git works Official..A Spot the differences Page 28

How Git works Official..A and will both have their own repositories, no different from the official one. Page 29

How Git works git clone URL git clone URL s..a Official..A s..a First step is to clone the, not check it out. This gives you a local clone of the entire repo! Page 30

How Git works git checkout A s..a can now work locally (and offline), without worrying about other repositories. Page 31

How Git works vim git add git commit A s..a edits as usual, adds her changes to the new revision, and commits it. Page 32

How Git works B s..b Revision B, based on A, is now in s. Page 33

How Git works s A B In our Git example, has committed revision B onto revision A. Page 34

How Git works s A B C In our Git example, has committed revision B onto revision A. She can then commit another revision C onto that. Page 35

Push and pull in Git git push s..c A..C Official..A s..b' can push her new revisions to another, such as the official one. The revision being pushed must be a descendant of the remote one. Page 36

Push and pull in Git s..c Official..C s..b' The official now contains s changes. Notice has also committed B' but not yet pushed! Page 37

Push and pull in Git s A B s commit graph has his new revision, but none of s. Page 38

Push and pull in Git git push s..c Official..C s..b' cannot push his changes yet, because B' is not a descendant of C. Page 39

Push and pull in Git git pull s..c Official..C A..C s..b' needs to get s new changes and merge them. First he pulls the revisions from the official repo... Page 40

Git merges s A B C B'... and they are added to his. He can now merge s changes with his. Page 41

Git merges s A B B' C D This creates a new merge revision D which has two parents: B' and C. Page 42

Coming full circle git push s..c Official..C s..d Since D is a descendant of C, can now push! Page 43

Coming full circle s..c Official..D s..d The official now has revision D, which contains both s and s changes. Page 44

Coming full circle git pull BOB_URL s..c Official..D s..d C..D Developers can also collaborate directly. Here gets s latest revisions directly from himself rather than from the official. Page 45

Coming full circle s..d Official..D s..d This could be used, for instance, to collaborate on experimental features that aren t ready for prime-time. Page 46

Trends in version control Isolated to collaborative Serial to concurrent Linear to branching Centralized to distributed Limited workflows to many possibilities Page 47