Branching and Merging

Similar documents
Review Version Control Concepts

Visualizing Git Workflows. A visual guide to 539 workflows

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

Using Git to Manage Source RTL

Technology Background Development environment, Skeleton and Libraries

Github/Git Primer. Tyler Hague

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

Version control CSE 403

CS 390 Software Engineering Lecture 5 More Git

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

Prof. Dr. Marko Boger. Prof. Dr. Christian Johner. Version Management

Software Engineering

Version control CSE 403

Tizen/Artik IoT Practice Part 4 Open Source Development

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group

Documentation External Synchronization FirstSpirit

Lab 08. Command Line and Git

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

Version control CSE 403

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

b. Developing multiple versions of a software project in parallel

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

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

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

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

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

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

Code Repository. P Blanchfield

Software Development I

Git Branching for Agile Teams

Beyond git add/commit/push

Introduction to Git and Github

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

How To Use Git. Advanced: Tags & Branches. Mary Kate Trost July 8, 2011

Technology Background Development environment, Skeleton and Libraries

I m an egotistical bastard, and I name all my projects after myself. First Linux, now git. Linus Torvalds, creator of Linux and Git

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

CS314 Software Engineering Configuration Management

CS 320 Introduction to Software Engineering Spring February 06, 2017

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

What is JIRA? software development tool. planning and tracking the projects progress and supporting the team collaboration

USER GUIDE MADCAP LINGO Source Control: Git

Revision control systems (RCS) and. Subversion

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

Software configuration management

Use git rm to remove files from workspace

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

Project Management. Overview

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Tutorial 2 GitHub Tutorial

Version Control System GIT

Software Project (Lecture 4): Git & Github

AIS Grid School 2015

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

Hands-On Lab. Getting Started with Git using Team Foundation Server Lab version: Last updated: 12/30/2013

Windows. Everywhere else

CSC 2700: Scientific Computing

Object Oriented Programming. Week 1 Part 2 Git and egit

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

Introduction to Git and GitHub. Tools for collaboratively managing your source code.

How technical excellence helps in LeSS adoption. Anton Bevzuk Dodo Pizza Chief Agile Officer

Git tutorial. Katie Osterried C2SM. October 22, 2015

Version Control Systems

Team Foundation Consulting. Training. Team Member Training User training designed to cater for specific roles within your team. Developer TFVC / Git

Git for Subversion users

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

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

CS108, Stanford Handout #37. Source Control CVS

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

Effective Programming Practices for Economists. 7. Version Control, Part II: Git with a Shared Repository

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

Configuration Management

GIT TO DA REPO! VERSION CONTROL, GITLAB, AND ISU

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

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

Laboratorio di Programmazione. Prof. Marco Bertini

Git(Lab) Tutorial and Hands-On

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

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

Intro to Github. Jessica Young

Revision control. INF5750/ Lecture 2 (Part I)

GETTING TO KNOW GIT: PART II JUSTIN ELLIOTT PENN STATE UNIVERSITY

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

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

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

Revision control Advanced git

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

Version Control for PL/SQL

Using GitHub for scientific research

Software Engineering I (02161)

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

Handout 4: Version Control Reference

C++ DATA TYPES BASIC CONTROL FLOW

A better way to collaborate in Drupal.org issue queues

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

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

Organising benchmarking LLVM-based compiler: Arm experience

Lab Objective. Lab Assignment. Downloads and Installation

Git Introduction CS 400. February 11, 2018

Git Workbook. Self-Study Guide to Git. Lorna Mitchell. This book is for sale at

Transcription:

Branching and Merging SWEN-261 Introduction to Software Engineering Department of Software Engineering Rochester Institute of Technology

Version control branching supports the ability to manage software releases. At the end of a sprint, the team will want to include done stories but exclude incomplete stories. This cannot be done when all of the stories are developed in the master branch. Feature branching is a technique that creates a branch for each story during development. Changes are isolated in specific branches. When the story is done, the feature branch is merged into the master branch. The master branch never receives incomplete work. Thus master is always the most up-to-date, working increment. 2

An example sprint at the end. Sprint 2 Backlog In Dev Ready for Test In Test Sprint 2 Done Sprint 1 Done S8 (5) S3 S1 S4 S2 S6 S5 3

The life cycle of the feature branch is tied to the development cycle of the story. 4

Two developers collaborate on a story by working on the same feature branch. The developers share code on a story by syncing to the same remote feature branch. 5

Two interdependent stories can share changes across two branches. The first story branch is created from master and the second branch is created from the first. Not shown are the coordinating remote branches 6

Merging happens a lot and usually goes well; other times not so much. Every time you sync with the remote a merge occurs. A "fast forward" is when your local branch has no additional changes and your local branch is just moved to the commit point of the remote. If your local changes do not overlap with the changes fetched from the remote, then an automatic merge is possible. A conflict occurs when there is at least one file with overlapping changes. 7

Here's an example of a merge conflict. Imagine there is a bug in a method: /** * Calculate a half-off discount. */ public float calculatediscount(final float cost) { return cost * 2; } Independently, two developers fix this bug: Betty did this: return cost / 2; Sam did this: return cost * 0.5f; 8

When a conflict occurs git reports the affected files. When Sam merges in the code from Betty: git merge dev1 Auto-merging src/main/java/com/example/model/promotion.java CONFLICT (content): Merge conflict in src/main/java/com/example/model/promotion.java Automatic merge failed; fix conflicts and then commit the result. Sam now has to fix the conflict; seen here: public float calculatediscount(final float cost) { <<<<<<< HEAD return cost * 0.5f; The HEAD in Sam's workspace. ======= return cost / 2; This is the code from Betty's branch. >>>>>>> dev1 } 9

Resolving a simple text conflict is often easy. Determine the best solution, and remove the other solution and the marker text. /** * Calculate a half-off discount. */ public float calculatediscount(final float cost) { return cost / 2; } Then add (and commit) the resolved change: git commit am "Fixed discount calculation" Push it. 10

There are other challenges when merging. 11 Binary files Document files, such as Word or Excel, are binary and cannot be merged. Such files should have an owner who is responsible for moderating changes. And a clear protocol for permitting team members access. Tree structures Types: file name changes directory name changes moving files and directories Why: Java package changes Class name changes

To minimize the number of times when conflicts will not resolve easily, follow several guidelines. 1. Keep code lines short; break up long calculations. 2. Keep commits small and focused. 3. Minimize stray edits. 4. If multiple developers are collaborating on a feature, each developer should sync with the remote branch regularly. Merge in the remote branch and then push to it, if you have changes. 5. If development of a feature is taking a long time, back merge master to sync completed features for this sprint into the feature branch. 12

Using feature branches will now become a standard part of your development workflow. 13