Advanced Computing Tools for Applied Research Chapter 4. Version control



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

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

Source Control Systems

Work. MATLAB Source Control Using Git

Data management on HPC platforms

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.

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

Version control with Subversion

Introducing Xcode Source Control

Version Control for Computational Economists: An Introduction

CSCB07 Software Design Version Control

Version Control! Scenarios, Working with Git!

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

Revision control systems (RCS) and

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

Distributed Version Control with Mercurial and git

Two Best Practices for Scientific Computing

Continuous Integration. CSC 440: Software Engineering Slide #1

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

Continuous Integration and Delivery at NSIDC

Zero-Touch Drupal Deployment

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

Theme 1 Software Processes. Software Configuration Management

Introduction to Version Control

An Introduction to Mercurial Version Control Software

Version Control with. Ben Morgan

Subversion Integration for Visual Studio

Content. Development Tools 2(63)

CS 2112 Lab: Version Control

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

Version Control with Git. Dylan Nugent

BlueJ Teamwork Tutorial

MATLAB & Git Versioning: The Very Basics

Distributed Version Control

Version Control with Git. Kate Hedstrom ARSC, UAF

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

Improving your Drupal Development workflow with Continuous Integration

Using GitHub for Rally Apps (Mac Version)

Version Control Tutorial using TortoiseSVN and. TortoiseGit

Continuous Integration

Git, GitHub & Web Hosting Workshop

Version Control with Git

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

Mercurial. Why version control (Single users)

Introduction to the Git Version Control System

Source Code Control & Bugtracking

Introduction to Version Control with Git

Version Control using Git and Github. Joseph Rivera

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

SOFTWARE DEVELOPMENT BASICS SED

Version Control with Git

Version Uncontrolled! : How to Manage Your Version Control

Introduc)on to Version Control with Git. Pradeep Sivakumar, PhD Sr. Computa5onal Specialist Research Compu5ng, NUIT

Software Configuration Management and Continuous Integration

How To Manage Source Code With Git

Software configuration management

Version Control with Subversion

Using Git for Project Management with µvision

What CCPForge does Introduction to SESC and CCPForge Workshop Gemma Poulter

Introduction to Subversion

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

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

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

Master s Thesis. git-sprite: Supporting Tool for Pull-Based Software Development Model. Yusuke Saito

Version Control with Subversion

Software Development and Collaboration: Version Control Systems and Other Approaches

Introduction to Programming Tools. Anjana & Shankar September,2010

Version Control Systems

Double Feature Talk. 1) Intro to SSL 2) Git Basics for Devs & Designers

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

Version Control with Subversion and Xcode

Software Version Control With Mercurial and Tortoise Hg

using version control in system administration

Version control with GIT

Jazz Source Control Best Practices

Miguel A. Figueroa Villanueva Xabriel J. Collazo Mojica. ICOM 5047 Capstone Miguel A. Figueroa Villanueva University of Puerto Rico Mayagüez Campus

Module 11 Setting up Customization Environment

Version Control. Version Control

Setting up a local working copy with SVN, MAMP and rsync. Agentic

Version Control. Luka Milovanov

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

FEEG Applied Programming 3 - Version Control and Git II

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

Version Control Tools

Putting It All Together. Vagrant Drush Version Control

Revision Control. Solutions to Protect Your Documents and Track Workflow WHITE PAPER

Transcription:

Advanced Computing Tools for Applied Research Jaime Boal Martín-Larrauri Rafael Palacios Hielscher Academic year 2014/2015

1 Version control fundamentals 2

What you probably do now Manually save copies of files or folders (into a backup directory?) file-v1.6-copy2-works.m If you are smart, the files or folders might be time-stamped 2015-02-23-file-v1.6-copy2-works.m Even better, you might also save your documents in a cloud storage service Keep them in sync throughout all your devices Limited file history 3

How do you get to this situation? 4

Pros and cons of your current approach Extremely simple Error prone Accidental file overwriting The original version may never be retrieved again Difficult to find the appropriate version Need to keep a revision history file Never up-to-date! Communicate updates via email to your team Difficult to keep track of who made a change and when it happened 5

What is version control and why should you care? Version control (also known as revision control or source control) is a system that records and manages changes to a file or set of files over time so specific versions can be recalled later. Roll back code to previous states Identify when and how bugs were introduced Keep multiple versions of the same code in sync across computers Work concurrently on the same file an then merge all changes You should use version control for almost everything Software development Document writing (papers, PhD thesis ) 6

Types of version control systems Local version control systems Obsolete Revision control system (RCS) Centralized version control systems (CVCS) Concurrent versions system (CVS) Subversion (SVN) Distributed version control systems (DVCS) Git Mercurial (Hg) Plastic SCM 7

Centralized version control systems The repository is located in one place and provides access to many clients Everything must be set and received from this central repository 8

Centralized version control systems Advantages Easy to understand More control over users and access (served from a single place) Simple to get started Disadvantages Dependent on access to the server It is hard to manage a server and backups It can be slower because every command connects to the server Branching and merging tools are difficult to use 9

Distributed version control systems Each user has its own copy of the entire repository, not just the files but the history as well It can be regarded as a network of individual repositories 10

Distributed version control systems Advantages More powerful and detailed change tracking Less conflicts Server not required (everything except syncing repositories is local) Branching and merging are more reliable It is fast Disadvantages The distributed model is harder to understand It is easier to make mistakes until you are familiar with the model Steeper learning curve 11

DVCS Project hosting services GitHub Unlimited users for free Charges for private repositories You can claim free private repositories if you are in academia Supports only Git Mac and Windows client Bitbucket Limited to 5 users for free Private repositories Supports Git and Mercurial Other alternatives Beanstalk, Gitorious, GitLab, Google code, Kiln 12

2 13

Git Facts It has seen a rapid growth over the past few years thanks to the open-source community Used by major companies Heavily terminal-based Thank Linus Torvalds for it Fortunately there are many GUI clients available 14

Git Basic terminology Repository: Files or directories that are under version control Metadata in hidden directory.git Clone: Create a local copy of a repository Branch: An independent line of development Default development branch: master Production code Commit: Collection of actions that are submitted together to the version control system It is a snapshot of every file in your repository Merge: Integrate changes from divergent branches 15

Git File states Image source: Git 16

Git File status Image source: Git 17

3 18

GitHub flow Create a branch Never modify the master branch directly Anything on the master branch is always deployable Always create a new branch to work on a feature or fix Branch names should be descriptive Check https://guides.github.com/introduction/flow/ for more details Image source: GitHub 19

GitHub flow Add commits Commits naturally create a transparent development history to keep track of your work Write messages in present tense as if they were commands Fix bug #1 Keep commits small One commit per logical change: fix a typo, fix a bug, add a function This way commit messages make sense Image source: GitHub 20

GitHub flow Open a pull request Pull requests help start code review and conversation about proposed changes before merging them into the master branch Image source: GitHub 21

GitHub flow Discuss and review your code The person or team reviewing your request will give you feedback You can continue making commits to correct any issues detected Image source: GitHub 22

GitHub flow Merge and deploy Once the pull request has been accepted it can be safely merged If done locally you will have to sync the changes with the server afterwards Conflicts may occur during merges Single user makes modifications in multiple machines Single user changes directly on GitHub Several users work on the same files simultaneously Image source: GitHub 23

References Git, Git documentation, 2015. http://git-scm.com/doc/ Atlassian, Getting Git right, 2015. https://www.atlassian.com/git/ Wildbit, LLC, Beanstalk guides, 2007 2015. http://guides.beanstalkapp.com GitHub, GitHub guides, 2015. https://guides.github.com Git Tower, Learn version control with Git, 2015. http://git-tower.com/learn/ S. Mutch, Version control tutorial, 2013. http://smutch.github.io/versioncontroltutorial/index.html 24