CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

Similar documents
Advanced Computing Tools for Applied Research Chapter 4. Version control

Software configuration management

Revision control systems (RCS) and

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

Git Basics. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 22

Continuous Integration and Delivery at NSIDC

Version Control using Git and Github. Joseph Rivera

Version Control Using Subversion. 12 May 2013 OSU CSE 1

Version Control! Scenarios, Working with Git!

Source Control Systems

Version Control with Subversion

Version Control. Luka Milovanov

Using Git for Project Management with µvision

Software Configuration Management. Slides derived from Dr. Sara Stoecklin s notes and various web sources.

Software Configuration Management. Context. Learning Objectives

Continuous Integration. CSC 440: Software Engineering Slide #1

Software Configuration Management

CSCB07 Software Design Version Control

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

Version Control with. Ben Morgan

SOFTWARE DEVELOPMENT BASICS SED

Version Control with Git. Linux Users Group UT Arlington. Rohit Rawat

Version Control Systems

Version Control Systems: SVN and GIT. How do VCS support SW development teams?

Introduction to the Git Version Control System

Content. Development Tools 2(63)

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

Lab Exercise Part II: Git: A distributed version control system

Two Best Practices for Scientific Computing

Introducing Xcode Source Control

Version Uncontrolled! : How to Manage Your Version Control

Version Control with Git. Kate Hedstrom ARSC, UAF

Continuous Integration

Gitflow process. Adapt Learning: Gitflow process. Document control

DAVE Usage with SVN. Presentation and Tutorial v 2.0. May, 2014

Git Branching for Continuous Delivery

Introduction to Subversion

Version Control with Git. Dylan Nugent

Git, GitHub & Web Hosting Workshop

Software Configuration Management (SCM)

Annoyances with our current source control Can it get more comfortable? Git Appendix. Git vs Subversion. Andrey Kotlarski 13.XII.

Version Control for Computational Economists: An Introduction

Improving your Drupal Development workflow with Continuous Integration

JavaScript Applications for the Enterprise: From Empty Folders to Managed Deployments. George Bochenek Randy Jones

An Introduction to Mercurial Version Control Software

Source Code Management/Version Control

Work. MATLAB Source Control Using Git

Distributed Version Control with Mercurial and git

MATLAB & Git Versioning: The Very Basics

Software Configuration Management.

Version Control Tools

Using GitHub for Rally Apps (Mac Version)

Software Configuration Management and Continuous Integration

TIME. Programming in the large. Lecture 22: Configuration Management. Agenda for today. About your Future. CM: The short version. CM: The long version

Module 11 Setting up Customization Environment

Version control with GIT

Surround SCM Best Practices

Version Control with Git

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

FEEG Applied Programming 3 - Version Control and Git II

Version Control with Subversion and Xcode

Introduction to Programming Tools. Anjana & Shankar September,2010

Version Control with Git

Introduction to Source Control ---

Theme 1 Software Processes. Software Configuration Management

Version control tracks multiple versions. Configuration Management. Version Control. V Software Engineering Lecture 12, Spring 2008

Beginners guide to continuous integration. Gilles QUERRET Riverside Software

Using Subversion in Computer Science

Data management on HPC platforms

CSE 70: Software Development Pipeline Build Process, XML, Repositories

The Hitchhiker s Guide to Github: SAS Programming Goes Social Jiangtang Hu d-wise Technologies, Inc., Morrisville, NC

Distributed Version Control

Git. A Distributed Version Control System. Carlos García Campos carlosgc@gsyc.es

Version control. HEAD is the name of the latest revision in the repository. It can be used in subversion rather than the latest revision number.

Putting It All Together. Vagrant Drush Version Control

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

OFBiz Addons goals, howto use, howto manage. Nicolas Malin, Nov. 2012

Git Basics. Christian Hanser. Institute for Applied Information Processing and Communications Graz University of Technology. 6.

Introduction to Version Control

Continuous Integration and Bamboo. Ryan Cutter CSCI Spring Semester

Beginning with SubclipseSVN

Jazz Source Control Best Practices

Continuous Keylane

CS108, Stanford Handout #33. CVS in Eclipse

Version Control. Version Control

MOOSE-Based Application Development on GitLab

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

Implementing Continuous Integration and Cloud Server Infrastructure for an International Enterprise Based In Finland

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

PKI, Git and SVN. Adam Young. Presented by. Senior Software Engineer, Red Hat. License Licensed under

Transcription:

Today: Source code control CPSC 491 Source Code (Version) Control Exercise: 1. Pretend like you don t have a version control system (e. g., no git, subversion, cvs, etc.) 2. How would you manage your source code as a team? imagine what this might be like, e.g.: editing different files editing different parts of the same file maintaining different versions of software 3. What might be some problems with this?

Version Control Examples of problems: could delete a file (or worse, many files) make changes but want to go back to an older version could overwrite other people s changes e.g., if 2 people work on same file, last one to save wins have to deal with a proliferation of files different versions of software (v1.0, v1.2, v1.4.6, v2.0, ) feature freeze and bug fix (merge back changes) In general, requires a lot of communication/coordination which will take up a lot of time... Version Control Version control software tries to alleviate this mess goes by many names version, revision, course (code) control configuration management A best (and now standard) practice in software eng. automates many otherwise tedious tasks manages versions efficiently (diffs) allows concurrent editing (some restrictions) many tools (git, svn, cvs, team foundation, etc.)

The plan... 1. Talk about basic concepts in version control 2. Talk about different workflows ( flows ) how to organize versions of software how to organize your development/deployment workflow 3. Go over basics of using git What can be versioned? Usually any kind of file source code build scripts (make, ant, ) configuration files images libraries documentation and so on So, more general than just source code

Configuration Item: An atomic object in the SCM system usually at the level of a file Configuration: Collection of specific configuration items all the objects (files) needed for the software product Version: A snapshot of a file or configuration at some time a version is frozen can t be changed new versions can be created and saved Version id: unique identifier for the version of the item used to obtain or compare previous versions systems differ on how versions assigned (and to what)

Branch: named copy of the configuration like a tree (but with special merge edges) paths through the tree are the branches main branch called the head or master branch At the configuration level Version 1 At the item level Version 3 Version 5 Version 2 Version 4 merge changes Version 6

Repository: where versions are stored a central location (server) where files stored e.g., ada houses a number of svn repos typically one repository per product (but not required) Workspace: local system where modifications happen Check out: initial download of a repository to a workspace in git this is called a clone Commit: save local changes to the repository creates a new version id for item(s) being committed stores a copy of the item under the new id most SCM systems are smart about storage: e.g., store first version then just diffs called a push in git, check in in svn

Update: get most recent versions of item(s) e.g., to get changes made by others in git this is called a pull Conflict: This can be bad! (sometimes) item changed and committed at the same time At the same time means... A & B update from same version A checks in first (becomes upstream change for B) B now has an out-of-date version B checks in Most systems won t let you check in if there is a conflict! How could this have been avoided? Always update before checking in! Many systems will handle the conflicts automatically as long as different parts of the code were changed

Merge: incorporate changes into a revised item 1. Alice and Bob update to v10 2. Alice modifies v10 3. Alice updates & commits to v11 4. Bob modifies v10 5. Bob updates 6. System tries to merge changes (if can t, a conflict exists) 7. Bob commits to v12 Fixing conflicts is done manually: e.g., using a text editor (on text files) or, by accepting yours or theirs (binary files) Optimistic vs. Pessimistic Concurrency Most systems use optimistic concurrency by default allow parallel modifications (of files) handle conflicts as needed This works in practice since conflicts are rare people don t usually work on the same thing if they do, they work together (communicate!)

Using pessimistic concurrency ensures sequential modifications using file locks default in rcs for modifying files (cvs, svn, git precursor) how it generally works check out file with a write lock (if not existing write locks) only person holding write lock can modify file after changes, check in and release write lock anyone can get a read lock Tag: a named point in history (configuration snapshot) typically used to mark a release point e.g., rc1.0 or v2.0 once tagged, doesn t change (different than a branch) the tag only denotes the configuration at that point in time

Subversion & Git Both are open-source and free version control systems Subversion: Central repository, distributed clients Predates git, but after cvs (which was after rcs) local changes aren t versioned until checked in only the central repository has complete history Git: Fully distributed cloning a repository copies entire history allows for local versioning & faster ops (not over network) can control access by controlling pull requests branching is a core concept (e.g., local repos are branches) Centralized Workflow Workflows [Atlassian] essentially the subversion model only one master branch developers clone master make changes pull changes from master then push changes to master

Workflows [Atlassian] Feature Branch Workflow (aka GitHub Flow) still use a centralized master branch holds a stable / deployable version of the product all feature development done in a dedicated branch descriptively named according to the feature stored in the central repository so multiple people can work on a feature branch once a feature branch is ready to become part of master a pull request is issued (ask to be merged w/ master) team can review & discuss changes once accepted, the feature branch is pulled into master Git-Flow Workflow Workflows [Atlassian] stricter (& more complicated) version of GitHub Flow specific roles for different branches how and when they interact historical branches a master and a develop branch master stores official history develop is an integration branch for features commits tagged in master w/ version number (v0.1, v1.2)

Git-Flow Workflow (cont) Workflows [Atlassian] Feature branches each feature in a separate branch but off of develop (parent branch) instead of master when completed, feature merged back into develop Release branches once ready for a release fork (copy) a release branch off of develop can then continue adding new features to develop once ready to deploy, merge release with master (and tag) release also merged back with develop Workflows [Atlassian] Git-Flow Workflow (cont) Maintenance ( hotfix ) branches used to quickly patch production releases (e.g., bug fixes) these are the only branches off of master as soon as the fix is complete, merge into master & develop master tagged with updated version number

Workflows [Atlassian] Git-Flow Workflow (cont) Next Time We ll look at using some actual git commands and meet in the lab!