Version control CSE 403

Similar documents
Version control CSE 403

Version control CSE 403

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

Distributed Version Control

Version Control with Git ME 461 Fall 2018

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

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

Tools for software development:

Visualizing Git Workflows. A visual guide to 539 workflows

Review Version Control Concepts

Git: Distributed Version Control

Git: Distributed Version Control

Lab 08. Command Line and Git

Git for Subversion users

Technology Background Development environment, Skeleton and Libraries

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

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

CS 320 Introduction to Software Engineering Spring February 06, 2017

Revision control. INF5750/ Lecture 2 (Part I)

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)

Git Workflows. Sylvain Bouveret, Grégory Mounié, Matthieu Moy

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

Laboratorio di Programmazione. Prof. Marco Bertini

Software Development I

Revision control systems (RCS) and. Subversion

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

CSC 2700: Scientific Computing

Introduction to Git and Github

Common Configuration Management Tasks: How to Do Them with Subversion

Version Control Systems

Version Control: Gitting Started

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

Configuration Management

Subversion Branching and Merging. Jan Skalický

Version Control Systems (Part 1)

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

Version Control Systems (VCS)

Subversion Repository Layout

Version Control System GIT

Software Tools Subversion

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

Practical C Programming

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

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

CS314 Software Engineering Configuration Management

Version Control System - Git. zswu

AIS Grid School 2015

The Rock branching strategy is based on the Git Branching Model documented by Vincent Driessen.

Handout 4: Version Control Reference

Project Management. Overview

Git tutorial. Katie Osterried C2SM. October 22, 2015

A Short Introduction to Subversion

Version Control. Version Control

FAQ Q: Where/in which branch do I create new code/modify existing code? A: Q: How do I commit new changes? A:

Version Control Systems: Overview

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

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

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

Intro Git Advices. Using Git. Matthieu Moy. Matthieu Moy Git 2016 < 1 / 11 >

Using Git to Manage Source RTL

Branching and Merging

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

CSE 331 Software Design & Implementation

Technology Background Development environment, Skeleton and Libraries

Hg Tutorial. For : COP Object oriented Programming (Using C++) Biswas Parajuli

Using git to download and update BOUT++

Version Control. Version Control

Decentralized Version Control Systems

Version Control. CSC207 Fall 2014

Revision Control. An Introduction Using Git 1/15

b. Developing multiple versions of a software project in parallel

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

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

FEEG Applied Programming 3 - Version Control and Git II

From theory to practice: Standard tools Software carpentry, Part II. Pietro Berkes, Brandeis University

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

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

Software Development. Using GIT. Pr. Olivier Gruber. Laboratoire d'informatique de Grenoble Université de Grenoble-Alpes

CS108, Stanford Handout #37. Source Control CVS

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

Push up your code next generation version control with (E)Git

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 with Git

Apache Subversion Tutorial

Tizen/Artik IoT Practice Part 4 Open Source Development

Introduction to Supercomputing

Fundamentals of Git 1

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

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

Software Engineering

Version control. what is version control? setting up Git simple command-line usage Git basics

Lecture 6 Remotes. Sign in on the attendance sheet!

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

An Introduction to Subversion

COSC345 Software Engineering. Version Control

TDDC88 Lab 4 Software Configuration Management

INET

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

A BASIC UNDERSTANDING OF VERSION CONTROL

Transcription:

Version control CSE 403

Goals of a version control system Keep a history of your work Explain the purpose of each change Checkpoint specific versions (known good state) Recover specific state (fix bugs, test old versions) Coordinate/merge work between team members Or yourself, on multiple computers or multiple features

Varieties of version control system Centralized VCS Database (history) Distributed VCS Repository Repository Edit, compile, Repository Repository Repository Working copy Working copy Working copy commit update One repository Many working copies Working copy Working copy Many repositories Working copy One working copy per repository (More complicated topologies are possible)

Reality Version control history Centralized VCS (one of these) Distributed VCS #1 (original) #1 (original) #1 (original) #1 (original) #2 by A #2 by A #3 by B #2 by A #4 by A #3 by B #4 by A #6 by B #4 by A #3 by B #5 by A #5 by A #2 by A #5 by A #6 by B #3 by B #4 by A #6 by B #6 by B #5 by A Rewrites history Multiple visible commits per dev. #7: merge Preserves history Multiple commits, one visible push per dev.

Distributed VCS history #1 (original) #2 by A #4 by A #3 by B Normal commit; edits files Working copy can be updated to any revision in the history #8 by C #5 by A #6 by B #7: merge Also a commit; only merges differences (if any) #9: merge

Advantages of a distributed VCS checkpoint work without publishing to teammates commit, examine history when not connected to the network more accurate history more effective merging algorithms Less important in CSE 403: share changes selectively with teammates flexibility in repository organization and workflow faster performance

A DVCS prohibits* some operations No update if uncommitted changes exist must commit first No push if not ahead of remote must pull & merge first No partial update (e.g., updating just one directory) update gets all changes in a changeset (= a commit) Rationale: Maintain more accurate, complete history Keep all users in sync Avoid painful conflicts Avoid loss of work

repo Coordinating with others pull incorporates others changes into your repository commit (update brings changes into your working copy) (N.b.: git pull does pull, merge, and update) If you are behind, nothing more to do Behind = your history is a prefix of master history If you have made changes in parallel, you must merge Merge = create a new version incorporating all changes repo update repo repo w.copy w.copy w.copy #2 by A #4 by A #5 by A #1 (original) #3 by B #6 by B #7: merge

Do two changes conflict? Conflict-free Changes are to different lines of a file Conflicting Simultaneous changes to the same lines of a file Requires manual conflict resolution Conflict-free is a textual, not semantic, notion A heuristic about when to get the user involved Could yield compile errors or test failures Git records changes at line granularity Darcs can record word substitution (for code refactoring) Git diff algorithm is customizable

Resolving conflicts There are three versions of the file: You decide which version to keep or how to merge them Many merge tools exist my changes ancestor Configure your DVCS to use the merge tool that you prefer Practice this ahead of time! Don t panic! Instead, think. You can always bail out of the merge and start over You have the full local and remote history) remote changes

Popular DVCSes Git (git) Others: Mercurial (hg), Bazaar, Darcs, Git is integrated with the GitHub hosting site and other tools Otherwise, similar functionality Git has an idiosyncratic command set

Hints Don t forget to update after you pull git pull does pull, merge, and update Not symmetric with git push, but usually does what you want To use DVCS just like Subversion: svn update = git pull svn commit = git commit; git push

Binary files are not diffable The history database records changes, not the entire file every time you commit The diff algorithm works line-by-line Avoid binary files (especially simultaneous editing) Word.doc files Do not commit generated files Binaries (e.g.,.class files), etc. Wastes space in repository Causes merge conflicts

Synchronize with teammates often Pull often Avoid getting behind the master or your teammates Push as often as practical Don t destabilize the master build Use continuous integration (automatic testing on each push)

Commit often Make many small commits, not one big one Easier to understand, review, merge, revert How to make many small commits: Do only one task at a time commit after each one Do multiple tasks in one clone Commit only a subset of files (use Git s staging area) Error-prone Create a new clone for each simultaneous task Can have as many as you like Create a branch for each simultaneous task Somewhat more efficient Somewhat more complicated and error-prone Easier to share unfinished work with teammates

More ways to avoid merge conflicts Modularize your work Divide work so that individuals or subteams own a module Other team members only need to understand its specification Requires good documentation and testing Communicate about changes that may conflict Don t overwhelm the team with such messages