Review Version Control Concepts

Similar documents
Branching and Merging

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:

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

Version control CSE 403

Version control CSE 403

CS 390 Software Engineering Lecture 5 More Git

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

Technology Background Development environment, Skeleton and Libraries

Version control CSE 403

Github/Git Primer. Tyler Hague

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

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

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

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

Tizen/Artik IoT Practice Part 4 Open Source Development

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

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

Version Control System GIT

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

Lab 08. Command Line and Git

b. Developing multiple versions of a software project in parallel

CSC 2700: Scientific Computing

Technology Background Development environment, Skeleton and Libraries

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

Documentation External Synchronization FirstSpirit

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

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

Software Engineering

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

Software configuration management

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

Introduction to Git and Github

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

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

Use git rm to remove files from workspace

Windows. Everywhere else

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

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

Version Control with Git ME 461 Fall 2018

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

Git tutorial. Katie Osterried C2SM. October 22, 2015

AIS Grid School 2015

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

Using Git to Manage Source RTL

Software Development I

Git for Subversion users

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

USER GUIDE MADCAP LINGO Source Control: Git

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

Project Management. Overview

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

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

CS314 Software Engineering Configuration Management

CS 320 Introduction to Software Engineering Spring February 06, 2017

February 2 nd Jean Parpaillon

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

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

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

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

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

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

Lab Objective. Lab Assignment. Downloads and Installation

Object Oriented Programming. Week 1 Part 2 Git and egit

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

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

Version Control. Ioannis N. Athanasiadis. with slides from Solution Perspective Media and Software Carpentry

Laboratorio di Programmazione. Prof. Marco Bertini

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

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

Configuration Management

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

Revision control systems (RCS) and. Subversion

TCSS 360: SOFTWARE DEVELOPMENT AND QUALITY ASSURANCE

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

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

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

Introduction to Version Control with Git

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

Git Branching for Agile Teams

Revision control Advanced git

Beyond git add/commit/push

Software Project (Lecture 4): Git & Github


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

Version Control Systems

Version Control Systems (VCS)

CSE 160: Introduction to Parallel Computation

Revision control. INF5750/ Lecture 2 (Part I)

Git for Version Control

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

Git for Newbies. ComMouse Dongyue Studio

Tools for software development:

Distributed Version Control

Code Repository. P Blanchfield

Intro to Github. Jessica Young

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

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

Software Engineering I (02161)

Experimental Psychology Lab Practice tidy cooperation

Transcription:

Review Version Control Concepts SWEN-261 Introduction to Software Engineering Department of Software Engineering Rochester Institute of Technology

Managing change is a constant aspect of software development. The Product and Sprint backlogs represent the upcoming changes. A software release is a snapshot of code at a certain time. Capturing a certain set of user stories Multiple releases may be done so the team needs to keep track of multiple snapshots (aka versions) Version control systems (VCS) are used to manage changes made to software and tag releases. 2

There are a few fundamental activities of change management that every VCS supports. Directories and files are tracked in a repository. Each developer has their own workspace. But share a common remote repository. You can Make changes in your workspace Add files or directories Remove files or directories Modify or move files Binary files are tracked as a single unit Commit the changes to a repository. Sync your workspace with a repository. Create branches to track user stories. Explore the history and changes to a repository. 3

Git has four distinct areas that your work progresses through. This is your local working directory where you do your development work. This is your local copy of the shared remote repository which may not be in sync with the remote. Working Staging Local Remote These are the changes that you specified you want in your next commit to the local repository. This is the shared remote repository that you use to synchronize your work with the rest of the team's work. 4

Your local repository and working copy do not automatically stay in sync with the remote. A merge incorporates new changes fetched to the local repository into the current branch that your working copy is on. A fetch synchronizes the local repository with the remote repository. merge fetch Working Local Remote pull fetch merge A branch is an independent stream of repository changes which isolates work from the rest of the repository. A merge may detect changes that can not be automatically incorporated. This is called a merge conflict. 5

When you make local changes, those changes must pass through all four areas. You add to the staging area all of your working copy changes that you want to commit. Finally, you push the changes to the remote repository. Works on files add commit push Working Staging Local Remote Then you commit those changes to your local copy of the repository. The default behavior for git will not allow you to push to the remote repository if your local repository is not up-to-date with remote. Getting in sync may create merge conflicts with your local changes that you will have to fix. 6

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. 7

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 8

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

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. 10

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 11

Merging happens a lot and usually goes well; other times not so much. Every time you sync with the remote repository a merge occurs. A merge conflict occurs when there is at least one file with overlapping changes that can not be automatically resolved. 12

Here's an example of a merge conflict. Consider Betty and Sam independently fix this bug. /** * Calculate a half-off discount. */ public float calculatediscount(final float cost) { return cost * 2; } Betty did this: return cost / 2; Sam did this: return cost * 0.5f; 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 13 Automatic merge failed; fix conflicts and then commit the result.

Resolving a simple text conflict is often easy. When a conflict occurs git reports the affected files. public float calculatediscount(final float cost) { <<<<<<< HEAD return cost * 0.5f; ======= return cost / 2; >>>>>>> dev1 } The HEAD in Sam's workspace. This is the code from Betty's branch. Determine the best solution, and remove the other solution and the marker text. Then follow through with an add, commit, and push. 14

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 feature branch regularly. Merge in the remote feature 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. 15

Using feature branches will be a standard part of your development workflow. 16