Version (Source Code) Control SWEN-250

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

Version Control with Git ME 461 Fall 2018

Version Control. CSC207 Fall 2014

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

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

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

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

Revision control. INF5750/ Lecture 2 (Part I)

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

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

Introduction to Git and Github

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

Git Introduction CS 400. February 11, 2018

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

Software Tools Subversion


TDDC88 Lab 4 Software Configuration Management

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

Software Development I

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

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

Review Version Control Concepts

Software Revision Control for MASS. Git Basics, Best Practices

Version Control for Fun and Profit

Version Control Systems (Part 1)

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

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

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

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

CS314 Software Engineering Configuration Management

Version Control Systems

Tools for software development:

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

Git Branching for Agile Teams

CS 390 Software Engineering Lecture 3 Configuration Management

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

Version Control Systems: Overview

Version Control System GIT

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

Version control CSE 403

Lab 08. Command Line and Git

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

Version control system (VCS)

Revision control systems (RCS) and. Subversion

Version Control. Version Control

Version Control Systems (VCS)

Version control CSE 403

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Version Control System - Git. zswu

Distributed Version Control

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

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

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

Github/Git Primer. Tyler Hague

Lab Exercise Git: A distributed version control system

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

Software Project (Lecture 4): Git & Github

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

Source Code Control. Quiz with Explainations. Hans-Petter Halvorsen, M.Sc.

Using GitHub to Share with SparkFun a

Git, the magical version control

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

The Old World. Have you ever had to collaborate on a project by

Source Code Management wih git

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

Laboratorio di Programmazione. Prof. Marco Bertini

USER GUIDE. MADCAP FLARE 2017 r3. Source Control: Git

Project Management. Overview

Revision Control. An Introduction Using Git 1/15

Configuration Management

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

Source Code Control & Bug Tracking

EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

EGit in Eclipse. Distributed Verzion Control Systems

An Introduction to Subversion

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

Using Git to Manage Source RTL

CSE 391 Lecture 9. Version control with Git

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

b. Developing multiple versions of a software project in parallel

COSC345 Software Engineering. Version Control

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

A Practical Introduction to Version Control Systems

CS108, Stanford Handout #37. Source Control CVS

Agenda. - Final Project Info. - All things Git. - Make sure to come to lab for Python next week

Using git to download and update BOUT++

Version Control for the 2- Pizza Team: Merge Conflicts (ELLS 9.5) Armando Fox

Introduction to Version Control

12/7/09. How is a programming language processed? Picasso Design. Collaborating with Subversion Discussion of Preparation Analyses.

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

Version Control: Gitting Started

Getting the files for the first time...2. Making Changes, Commiting them and Pull Requests:...5. Update your repository from the upstream master...

Revision Control. Software Engineering SS 2007

Version Control. Version Control

How to be a git. Dominic Mitchell

Recap: Developer's Environment

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

Technology Background Development environment, Skeleton and Libraries

Week 5. CS 400 Programming III

Git. Presenter: Haotao (Eric) Lai Contact:

Transcription:

Version (Source Code) Control SWEN-250

Overview Motivation why is version control useful? Key concepts Variations on the basic theme Example version control systems 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 2

Motivation Progress, far from consisting in change, depends on retentiveness. Those cannot remember the past are condemned to repeat it. - George Santayana 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 3

Motivation Scenario: I think this will work Often we want to try out a change Trying a new algorithm or data structure Reorganizing code for clarity Experimenting with a half-cocked idea Seeing if the language works like you expect It s a lot easier if you can perform such experiments confidently. That is, you can get back to where you started VCS can provide a virtual trail of breadcrumbs If you botch things, you can return to a stable state 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 4

Motivation Scenario: How did I get here? Like waypoints on a GPS system. Allows you to track progress You can see how your program evolved and grew, step-bystep You can see where you made mistakes and how long it took you to find and fix them The fancy software engineering term is traceability. Important for scheduling, tracking, and planning Allows you to go back to a previous version ( hey, what did we ship for version 1.5.2.9.5? ) 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 5

Motivation Scenario: Reconstruct the Past Teacher: So, show me what was the code like before you made this change? You: Ummm... 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 6

Motivation: Pragmatic Programmers Tip 23 Always Use Source Code Control So let it be written So let it be done! 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 7

Key Concepts* A repository is a designated disk location (directory) where the files and breadcrumbs for a project are kept. The work area is a location (directory) where the activities of editing, compiling, testing, etc. take place. Files are periodically checked in to the repository from the work area, creating a new version. Files can be checked out of the repository (to start work on existing project, or to restore the state of the work area to a previous state). * Terminology slightly different with git 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 8

Check a File into a Repository Repository File.txt The quick brown the lazy dog. Working Area check File.txt into the Repository File.txt (1) The quick brown the lazy dog. Repository File.txt The quick brown the lazy dog. Working Area 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 9

Check a Changed File into a Repository File.txt (1) The quick brown the lazy dog. Repository File.txt The quick black the lazy cat. Working Area check File.txt into the Repository File.txt (1) The quick brown the lazy dog. Repository File.txt (2) The quick black the lazy cat. File.txt The quick black the lazy cat. Working Area 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 10

Revert to a Previous Version in a Repository File.txt (1) The quick brown the lazy dog. Repository File.txt The quick black the lazy cat. Working Area check version 1 of File.txt out to the Work Area File.txt (1) The quick brown the lazy dog. Repository File.txt (2) The quick black the lazy cat. File.txt The quick brown the lazy dog. Working Area 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 11

A Potential Problem We ll have multiple copies of File.txt that are almost the same won t this waste space? Yes unless we use deltas. Usually changes from version to version are small. We can save space by only saving the changes (deltas). Basically, we need additions, deletions, changes. Example: a lno appended_text d lno c lno start length new_text With smart differences and compression, deltas become very small. 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 12

Check in a Changed File (w/deltas) File.txt (1) The quick brown the lazy dog. Repository (version 1) File.txt The quick black the lazy cat. Working Area check File.txt into the Repository (using deltas) File.txt (1) The quick brown the lazy dog. Repository (version 2) File.txt (2) c 1 11 5 black c 3 10 3 cat File.txt The quick black the lazy cat. Working Area 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 13

Versioning by file: File vs. Repository Versioning Each file in repository has its own version number. Frequently changed files have higher numbers than stable files. May be difficult to find all the individual files representing one logical version. Versioning by repository: Any changes update the version number of the entire repository. Easy to find all files comprising a given system version. Harder to find specific version of a given file. 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 14

Centralized vs. Distributed Repositories Centralized: One master directory. All changes (by any team member) are applied to the master. Difficult for individuals to leave bread crumbs for their own experiments. Distributed: Every developer has own repository. Changes are done to local repository. If working on a team, periodically PUSH local changes to designated central repository. 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 15

Sample of Version Control Systems CVS Concurrent Versioning System Centralized File versioning Used in CS3 git from Linus Tovalds, creator of Linux Decentralized Repository versioning Used in this course Some others you may encounter SVN Subversion: Centralized, repository versioned TFS Team Foundation Services: Centralized & Distributed, file and repo versions RCS Revision Control System: Centralized, file versioned SCCS Source Code Control System: Centralized, file versioned 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 16

Git Understanding the machinery to whittle away the uncertainty Been here before? (web comic by XKCD) 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 17

Git vocabulary Repository: a place for storing things. With Git, this means your code folder head: A pointer to the latest code you were working on add: An action to ask Git to track a file commit: An action to save the current state such that one can revisit this state if needed remote: A repository that isn t local. Can be in another folder or in the cloud (for example: Github): helps other people to easily collaborate, as they don t have to get a copy from your system they can just get it from the cloud. Also, ensures you have a backup in case you break your laptop pull: An action to get updated code from the remote push: An action to send updated code to the remote merge: An action to combine two different versions of code status: Displays information about current repository status 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 18

Where is everything? $ tree.git/.git/ HEAD config description hooks applypatch-msg.sample commit-msg.sample post-update.sample pre-applypatch.sample pre-commit.sample pre-push.sample pre-rebase.sample pre-receive.sample prepare-commit-msg.sample update.sample info exclude objects info pack refs heads tags 8 directories, 14 files Introducing the magic controlled by a hidden folder:.git/ In every git repository, you ll see something like this 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 19

A good reference https://medium.freecodecamp.org/how-not-to-beafraid-of-git-anymore-fe1da7415286 1/10/2019 (c) 2013 RIT Dept. of Software Engineering 20