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

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

Visualizing Git Workflows. A visual guide to 539 workflows

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

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

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

API RI. Application Programming Interface Reference Implementation. Policies and Procedures Discussion

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

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

AIS Grid School 2015

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

CS 320 Introduction to Software Engineering Spring February 06, 2017

Version control CSE 403

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

Version control with Git.

Version Control Systems (VCS)

COSC345 Software Engineering. Version Control

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

Version control CSE 403

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

Code and data management with Git

Version Control Systems: Overview

CSC 2700: Scientific Computing

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

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

Distributed Version Control

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

b. Developing multiple versions of a software project in parallel

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

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

Git for Version Control

Git for Subversion users

Getting started with GitHub

Introduction to Git and Github


Version Control with Git ME 461 Fall 2018

Version Control Systems (Part 1)

Revision Control and GIT

CS 390 Software Engineering Lecture 5 More Git

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

Git tutorial. Katie Osterried C2SM. October 22, 2015

Git better. Collaborative project management using Git and GitHub. Matteo Sostero March 13, Sant Anna School of Advanced Studies

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

Software configuration management

Project Management. Overview

TCSS 360: SOFTWARE DEVELOPMENT AND QUALITY ASSURANCE

Using git to download and update BOUT++

A BASIC UNDERSTANDING OF VERSION CONTROL

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

Laboratorio di Programmazione. Prof. Marco Bertini

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

Version Control: Gitting Started

Online Remote Repositories

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

Github/Git Primer. Tyler Hague

Tizen/Artik IoT Practice Part 4 Open Source Development

Lab 08. Command Line and Git

Version Control. Collaborating with git. Tim Frasier

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Week 5. CS 400 Programming III

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

Git for Newbies. ComMouse Dongyue Studio

Version Control Systems

Version control CSE 403

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

Version Control System GIT

Git. Christoph Matthies Software Engineering II WS 2018/19. Enterprise Platform and Integration Concepts group

Belle II - Git migration

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

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

Revision control. INF5750/ Lecture 2 (Part I)

CSE 391 Lecture 9. Version control with Git

Beyond git add/commit/push

Improving Your Life With Git

EGit in Eclipse. Distributed Verzion Control Systems

a handful of Git workflows for the agilist steven harman twitter: stevenharman

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

Technology Background Development environment, Skeleton and Libraries

Using GitHub and SourceTree to work with DITA TC repositories

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

Decentralized Version Control Systems

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

A brief introduction to the GitLab service at the department

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

Software Project (Lecture 4): Git & Github

CS314 Software Engineering Configuration Management

Lecture 6 Remotes. Sign in on the attendance sheet!

Computer Science Design I Version Control with Git

Version Control with Git

Introduction, Instructions and Conventions

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

chatterbot-weather Documentation

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

Intro to Github. Jessica Young

Version Control with Git

Version Control System - Git. zswu

Version Control with GIT: an introduction

Version Control. CSC207 Fall 2014

Human Version Control

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

Introduction to Version Control

Transcription:

Welcome! Virtual tutorial will start at 15:00 GMT Please leave feedback afterwards at: www.archer.ac.uk/training/feedback/online-course-feedback.php

Introduction to Version Control (Part 2) ARCHER Virtual Tutorial

Reusing this material This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en_us This means you are free to copy and redistribute the material and adapt and build on the material under the following terms: You must give appropriate credit, provide a link to the license and indicate if changes were made. If you adapt or build on the material you must distribute your work under the same license as the original. Note that this presentation contains images owned by others. Please seek their permission before reusing these images.

Outline Part 1: common features of version control systems Part 2: different models of version control, workflows: Centralised (client-server) version control (CVS, SVN) Distributed (peer-2-peer) version control (Git, Mercurial) Workflows Hosting & additional features: issue tracking, pull requests Choosing a version control system

Centralised version control Examples of centralised (also known as client-server) version control systems: CVS Subversion (SVN) Perforce

Centralised version control Repository located on a central server Repository

Centralised version control Each user has a working copy of the repository Carol Alice Repository Bob Dave

Centralised version control New users check out a fresh working copy r123 Alice r123 Repository Carol r123 r123 Bob Dave r123

Centralised version control Users make changes to their working copy r123+changes Alice r123 Repository Carol r123 r123+changes Bob Dave r123

Centralised version control Users commit changes to the repository r123+changes Alice r124 Repository Carol r123 r123+changes Bob Dave r123

Centralised version control Users commit changes to the repository Ø First one to commit wins r124 Alice r124 Repository Carol r123 r123+changes Bob Dave r123

Centralised version control Users commit changes to the repository Ø First one to commit wins Ø Others must update & resolve any conflicts before committing r124 Alice r124 Repository Carol r123 r123+changes r124 Bob Dave r123

Centralised version control Users commit changes to the repository Ø First one to commit wins Ø Others must update & resolve any conflicts before committing r124 Alice r125 Repository Carol r123 r123+changes resolved + r124 Bob Dave r123

Centralised version control Users periodically synchronise by updating their working copies with the canonical content in the central repository r125 Alice r125 Repository Carol r125 r125 Bob Dave r125

Centralised version control Enforces centralised workflow linear global progress view (incrementing revision numbers) Need to be online to commit any changes No revision history stored locally, need to be online To check the log To check out any past committed versions of files All commits visible by all users of a repository Can discourage committing, experimenting Can discourage creating many branches

Centralised version control Communications with server cost time Server is single point of failure, requires configuration & maintenance: Downtime can affect many users Backups Security

Distributed version control Examples of distributed (also known as peer-2-peer) version control systems: Git Mercurial

Distributed version control Each user has their own repository stored locally Central server is optional Carol Alice Bob Dave

Distributed version control New users clone, i.e. copy, an existing repository Carol Alice Bob Dave

Distributed version control Users make changes in their working copy and commit this to their local repository è repositories diverge Carol Alice changes Bob changes Dave

Distributed version control To combine content from different repositories someone has to fetch other people s changes into their working copy and perform merges there Alice Carol Bob Dave

Distributed version control Branches from Carol and Dave are imported into Alice s repository and merged with one of her branches Alice Carol Bob Dave

Distributed version control How does the version control system know how to merge content from different repositories? How does it determine how far back to go in the revision history of two branches being merged until it finds a common ancestor? No single canonical repository so no global revision number (r###) that can be used to judge when commits diverge

Distributed version control Solution: Compute an ID uniquely identifying each commit Even better: Compute an ID uniquely identifying each commit and its preceding revision history Git and Mercurial accomplish this using a hash function (SHA-1) that generates a 40-digit hexadecimal number If two commits from different repos have the same ID they have identical revision histories and hence are common ancestors

Distributed version control Carol s branch 29ab2761 Dave s branch 29ab2761 46hhg315 Common ancestors 46hhg315 k1ga6814 g116ag11 881ja963 Start merging here Local commits k1ga6814 alc6b173 h1lnm2vu

Distributed version control Can use a central server for convenience: Ø Clone Carol Alice Server Bob Dave

Distributed version control Can use a central server for convenience: Ø Commit local changes Carol Alice Server changes Bob changes Dave

Distributed version control Can use a central server for convenience: Ø Push changes into separate branches in server repository Carol Alice Server Bob Dave

Distributed version control Can use a central server for convenience: Ø Fetch Carol and Dave s branches and merge Carol Alice Server Bob Dave

Distributed version control Don t need to be online to commit changes Changes can be committed privately Encourages committing early on Encourages branching to commit e.g. experimental code Full revision history (log & past versions) available locally Can adopt workflows other than centralised for combining content from contributors Many common operations are faster because no communication with server needed

Distributed version control No need to set up and maintain a server No single point of failure As many backups as repository clones Hash IDs allow exact verification of integrity of data Branches play a very important role Used to communicate between repositories Mercurial and Git have very efficient implementations of branching branching is cheap, and merging is clever

Hosting & additional features Distributed version control systems became very popular over the past ~8 years (Git born 2005) A number of websites (GitHub, Bitbucket, ) have helped fuel this trend and exploit the potential of distributed version control. GitHub etc. offer repository hosting and management and additional features that facilitate collaborative software development

Hosting & additional features Aditional features: Wiki to track and discuss bugs, feature requests etc. tightly integrated with version control workflow Pull request mechanism allowing developers to clone (fork) a repository, make changes, then suggest to the original owner that these changes are integrated into the parent repository Site-installable web-based repository management frameworks (e.g GitLab) offer similar features.

Distributed workflows Integration manager workflow: Reproduced under CC Attribution Non-Commercial Share Alike 3.0 license see http://git-scm.com/book/en/v2/distributed-git-distributed-workflows

Distributed workflows Dictator and lieutenants workflow: Reproduced under CC Attribution Non-Commercial Share Alike 3.0 license see http://git-scm.com/book/en/v2/distributed-git-distributed-workflows

Which version control system should I use? If you are joining an existing project: whatever is already being used! (unless there are big problems) Whatever your most important collaborators are used to Experiment! Git or Mercurial will allow you to immediately start committing privately and are fast and powerful Especially Git offers powerful options But easier to get lost than Mercurial when starting out

References further reading http://git-scm.com/book http://svnbook.red-bean.com/en/1.7/index.html http://www.github.com