Version Control! Scenarios, Working with Git!



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

Introducing Xcode Source Control

Version Control with. Ben Morgan

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

Version Control with Git

Version Control. Version Control

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

Revision control systems (RCS) and

CSCB07 Software Design Version Control

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.

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

Version Control with Subversion

Using Git for Project Management with µvision

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

MATLAB & Git Versioning: The Very Basics

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

Version Control using Git and Github. Joseph Rivera

Source Control Systems

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

CS108, Stanford Handout #33. CVS in Eclipse

Version Control Tutorial using TortoiseSVN and. TortoiseGit

FEEG Applied Programming 3 - Version Control and Git II

Version Control with Subversion and Xcode

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

MOOSE-Based Application Development on GitLab

Beginning with SubclipseSVN

Work. MATLAB Source Control Using Git

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

Data management on HPC platforms

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

Introduction to the Git Version Control System

Software Configuration Management and Continuous Integration

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

Source Control Guide: Git

Module 11 Setting up Customization Environment

Version Control with Git

Continuous Integration. CSC 440: Software Engineering Slide #1

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

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

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

EAE-MS SCCAPI based Version Control System

Using Subversion in Computer Science

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

Introduction to Version Control with Git

Advanced Computing Tools for Applied Research Chapter 4. Version control

INF 111 / CSE 121. Homework 4: Subversion Due Tuesday, July 14, 2009

Version Control Using Subversion. Version Control Using Subversion 1 / 27

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

SOFTWARE DEVELOPMENT BASICS SED

Lab 0 (Setting up your Development Environment) Week 1

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

Two Best Practices for Scientific Computing

CS 2112 Lab: Version Control

Version control with Subversion

Version control with GIT

Introduction to Version Control

Xcode Source Management Guide. (Legacy)

Manual. CollabNet Subversion Connector to HP Quality Center. Version 1.2

Version Control for Computational Economists: An Introduction

Software configuration management

How to set up Outlook Anywhere on your home system

Version Control with Git. Kate Hedstrom ARSC, UAF

Introduction to Source Control ---

Continuous Integration

Version Control with Git. Dylan Nugent

Software development. Outline. Outline. Version control. Version control. Several users work on a same project. Collaborative software development

Content. Development Tools 2(63)

Redmine: A project management software tool. January, 2013

BlueJ Teamwork Tutorial

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

Software Delivery Integration and Source Code Management. for Suppliers

Table of Contents. OpenDrive Drive 2. Installation 4 Standard Installation Unattended Installation

HowTo. Planning table online

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

Dalhousie University CSCI 2132 Software Development Winter 2015 Lab 7, March 11

Version Control Systems

Xopero Backup Build your private cloud backup environment. Getting started

Developer Workshop Marc Dumontier McMaster/OSCAR-EMR

Distributed Version Control with Mercurial and git

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

Theme 1 Software Processes. Software Configuration Management

Working with a Version Control System

Eliminate Workflow Friction with Git

Made Easy Windows Sync App Tutorial

Gmail Or other POP3

Distributed Version Control

Using GitHub for Rally Apps (Mac Version)

Subversion Integration for Visual Studio

Introduction to Programming Tools. Anjana & Shankar September,2010

User Guide Online Backup

MadCap Software. SharePoint Guide. Flare 11.1

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

Version Uncontrolled! : How to Manage Your Version Control

Sentral servers provide a wide range of services to school networks.

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

Transcription:

Version Control! Scenarios, Working with Git!!

Scenario 1! You finished the assignment at home! VC 2

Scenario 1b! You finished the assignment at home! You get to York to submit and realize you did not upload it! VC 3

Scenario 1c! You finished the assignment at home! You get to York to submit and realize you did not upload it! Has this ever happened to you?! VC 4

Scenario 2! Your program works pretty well! VC 5

Scenario 2b! Your program works pretty well! You make a lot of improvements! VC 6

Scenario 2c! Your program works pretty well! You make a lot of improvements! But you haven t got them to work yet! VC 7

Scenario 2d! Your program works pretty well! You make a lot of improvements! But you haven t got them to work yet! You need to demo your program now! VC 8

Scenario 3! You are working on the 2.0 version of your great app but 2.0 does not quite compile yet and a customer finds a critical bug in 1.0, which must be fixed ASAP! VC 9

Scenario 3b! You are working on the 2.0 version of your great app but 2.0 does not quite compile yet and a customer finds a critical bug in 1.0, which must be fixed ASAP! If you are smart, you have a copy of your 1.0 source. You make the change and release it but how do you merge your changes into your 2.0 program text?! VC 10

Scenario 3c! You are working on the 2.0 version of your great app but 2.0 does not quite compile yet and a customer finds a critical bug in 1.0, which must be fixed ASAP! If you are smart, you have a copy of your 1.0 source. You make the change and release it but how do you merge your changes into your 2.0 program text?! You you are not so smart, you have no source program text saved.! VC 11

Scenario 3d! You are working on the 2.0 version of your great app but 2.0 does not quite compile yet and a customer finds a critical bug in 1.0, which must be fixed ASAP! If you are smart, you have a copy of your 1.0 source. You make the change and release it but how do you merge your changes into your 2.0 program text?! You you are not so smart, you have no source program text saved.! You have no way to track down the bug and you lose face until 2.0 is ready! VC 12

Scenario 4! You change one part of a program! VC 13

Scenario 4b! You change one part of a program! It works! VC 14

Scenario 4c! You change one part of a program! It works! Your teammate changes another part! VC 15

Scenario 4d! You change one part of a program! It works! Your teammate changes another part! It works! VC 16

Scenario 4e! You change one part of a program! It works! Your teammate changes another part! It works! You put it together! VC 17

Scenario 4f! You change one part of a program! It works! Your teammate changes another part! It works! You put it together! It DOES NOT WORK! VC 18

Scenario 4g! You change one part of a program! It works! Your teammate changes another part! It works! You put it together! It DOES NOT WORK! What were all the changes?!! VC 19

Scenario 5! You make a number of improvements to a class! VC 20

Scenario 5b! You make a number of improvements to a class! Your teammate makes a number of different improvements to the same class! How can you merge these changes?! VC 21

A poor solution! There are a number of tools that help you spot changes differences between two files, such as diff! VC 22

A poor solution 2! There are a number of tools that help you spot changes differences between two files, such as diff! Of course, they won t help unless you kept a copy of the older version! VC 23

A poor solution 3! There are a number of tools that help you spot changes differences between two files, such as diff! Of course, they won t help unless you kept a copy of the older version! Differencing tools are useful for finding a small number of differences in a few files! VC 24

A poor solution 4! There are a number of tools that help you spot changes differences between two files, such as diff! Of course, they won t help unless you kept a copy of the older version! Differencing tools are useful for finding a small number of differences in a few files! A better solution! VC 25

Version control systems! Keep multiple, older and newer, versions of everything! VC 26

Version control systems 2! Keep multiple, older and newer, versions of everything! Not just program source text! VC 27

Version control systems 3! Keep multiple, older and newer, versions of everything! Not just program source text! Request comments regarding every change! VC 28

Version control systems 4! Keep multiple, older and newer, versions of everything! Not just program source text! Request comments regarding every change! Display differences between versions! VC 29

Version control systems 5! Keep multiple, older and newer, versions of everything! Not just program source text! Request comments regarding every change! Display differences between versions! Allow merging of changes on the same file! VC 30

Centralized version control! Traditional version control system! Server with database! Clients have a working version! VC 31

Centralized version control 2! Traditional version control system! Server with database! Clients have a working version! Examples! CVS! Subversion! VC 32

Centralized version control 3! Traditional version control system! Server with database! Clients have a working version! Examples! CVS! Subversion! Challenges! Multi-developer conflicts! Client/server communication! VC 33

Distributed version control 2! Authoritative server by convention only! Every working checkout is a repository! VC 34

Distributed version control 3! Authoritative server by convention only! Every working checkout is a repository! Get version control even when detached! VC 35

Distributed version control 5! Authoritative server by convention only! Every working checkout is a repository! Get version control even when detached! Backups are trivial! Examples! Git! Bitkeeper! VC 36

Terminology! A repository contains several branches! VC 37

Terminology 2! A repository contains several branches! The main branch is call the master! VC 38

Terminology 3! A repository contains several branches! The main branch is call the master! Branches break off from the master to try something new, e.g. a new feature, program text restructuring, etc.! VC 39

Terminology 4! A repository contains several branches! The main branch is call the master! Branches break off from the master to try something new, e.g. a new feature, program text restructuring, etc.! Branches can be merged with other branches or into the master! VC 40

Terminology 5! A repository contains several branches! The main branch is call the master! Branches break off from the master to try something new, e.g. a new feature, program text restructuring, etc.! Branches can be merged with other branches or into the master! Tags are usually official releases that have to be supported! VC 41

Working with git! We do the following! Create a repository online! VC 42

Working with git 2! We do the following! Create a repository online! Create a local repository, add a project to it, and push it to the online repository! VC 43

Working with git 3! We do the following! Create a repository online! Create a local repository, add a project to it, and push it to the online repository! All team members get the online repository! VC 44

Working with git 4! We do the following! Create a repository online! Create a local repository, add a project to it, and push it to the online repository! All team members get the online repository! Changes pushed by one team member can now be pulled by all! VC 45

Creating the repository! Once per tem! Go to github.com! Sign up for a new account! Create a new repository! Copy the URL to access your repository!! VC 46

Creating a local project repository! Once per team (practice example)! Run Eclipse! Create a new project called ProjectWithGit that contains a main method that prints Fun with Git! Go to Eclipse -> Preferences -> Team -> Git -> Configuration! Click Add Entry, add the pair [user.name, your_name]! Click Add Entry, add the pair [user.email, your_email]! These should be the same as the ones used at github.com! Click Apply, then OK! VC 47

Creating a local project repository 2! Once per team (practice example) cont d! Right click on ProjectWithGit and Select Team -> Share Project! Click on Create! Provide a name for your local repository, and click Finish! Your local repository is now setup! VC 48

Pushing the first local repository! Once per team (practice example) cont d! Right click on ProjectWithGit and select Team -> Commit! Provide name and email! Add a commit message! It is important that you add a message every time you commit makes it easier to find a version later! Select all files, and click Commit! Close editors, reopen, make a change to the output of your program and Commit again! VC 49

Pushing the first local repository 2! Once per team (practice example) cont d! Right click on ProjectWithGit and select Team -> Remote -> Push! Copy the URL from github.com in the URI field! Enter your github.com username and password, click NEXT! Select master from from the Source ref pull down menu! Click on Add All Branches Spec! Click Finish, then OK! You should be able to see ProjectWithGit in github.com! VC 50

Deleting the local repository! Once per team (practice example) cont d! Due to an Eclipse but, it is easy to delete the local repository, and re-get it from github.com along with the other team members! Right click on ProjectWithGit in Eclipse select Delete! Select to delete project contents on disk, and click OK! VC 51

Copying a repository! All team members! Start Eclipse! Go to File -> Import -> Git -> Projects from Git! Click Next, select Clone URI,! Keep clicking Next until you can click Finish! You now have a copy of the project in your local repository! To push changes to the remote repository, you will need a github.com account that is added as a collaborator! VC 52

Push to repository! Each team member! Make some changes to any of the classes in the project! Right click on any element that has changes (could be the whole project), and select Team -> Commit! Add a commit message! If you do not want to publish the changes yet, click Commit! If the changes are ready to be published, click Commit and Push! VC 53

Pull from repository! To get changes published by other team members! Right click on the project, and select Team -> Pull! VC 54

Homework! Get git working for every team member! For program text / documents / notes etc.! Demonstrate that everybody can pull / push program text in the next lab.! VC 55

Subversion (SVN)! A server holds all original files of a project!! VC 56

Subversion 2! A server holds all original files of a project! Gives out copies to participants!!! VC 57

Subversion 3! A server holds all original files of a project! Gives out copies to participants! Participants modify their copies and submit their changes to the server!!! VC 58

Subversion 4! A server holds all original files of a project! Gives out copies to participants! Participants modify their copies and submit their changes to the server! The server automatically merges changes into the original files!!! VC 59

Subversion conflicts! Conflicts only occur when modifications are done!! VC 60

Subversion conflicts 2! Conflicts only occur when modifications are done! By more than one participant!! VC 61

Subversion conflicts 3! Conflicts only occur when modifications are done! By more than one participant! At the same location in their respective copies!! VC 62

Subversion conflicts 4! Conflicts only occur when modifications are done! By more than one participant! At the same location in their respective copies! Then participants have to manually resolve such conflicts! VC 63

SVN support! Powerful edit and merge tools help make conflict management easy! VC 64

SVN support 2! Powerful edit and merge tools help make conflict management easy! SVN keeps a log of any changes made to any file! VC 65

SVN support 3! Powerful edit and merge tools help make conflict management easy! SVN keeps a log of any changes made to any file! Participants can go back and receive older versions of a file or even an older version of an entire project state! VC 66

SVN action Checkout! Receive a copy of an entire project from the SVN server! Source files! Project & make files! Resource files! Etc.! VC 67

SVN action Update! Receive copies of individual files or folders from the server! Merges the copies with your current local copy! VC 68

SVN action Commit! Sends an updated file (your local copy) to the SVN server! The copy is incorporated into the original project database! A new version number is assigned! VC 69

SVN action Commit 2! Sends an updated file (your local copy) to the SVN server! The copy is incorporated into the original project database! A new version number is assigned! Before doing a commit! You must do an update (and resolve any possible conflicts) before you commit.! VC 70

SVN action Add! Notifies SVN of a new file or folder that needs to be added to the existing project! Only if the SVN is aware of a file, can you commit the file! VC 71

SVN action Add! Notifies SVN of a new file or folder that needs to be added to the existing project! Only if the SVN is aware of a file, can you commit the file! You must use add before you can commit a new file or folder! VC 72

SVN action Add! Notifies SVN of a new file or folder that needs to be added to the existing project! Only if the SVN is aware of a file, can you commit the file! You must use add before you can commit a new file or folder! To delete a file you need to!! Delete it in your local folder! Then commit the folder! VC 73

Further considerations! Make sure to update regularly otherwise! You will have lots of conflicts! And lots of problems! VC 74

Further considerations 2! Make sure to update regularly otherwise! You will have lots of conflicts! And lots of problems! SVN will not help you! If you do not commit regularly! VC 75

Further considerations 3! Make sure to update regularly otherwise! You will have lots of conflicts! And lots of problems! SVN will not help you! If you do not commit regularly! If you add lots of new stuff! Make sure to commit everything! VC 76

Git advantages! Resilience! No one repository has more data than any other! VC 77

Git advantages 2! Resilience! No one repository has more data than any other! Speed! Very fast operations compared to other VCSs! VC 78

Git advantages 3! Resilience! Speed! No one repository has more data than any other! Very fast operations compared to other VCSs! Space! Compression can be done across the repository, not just per file! Minimizes local size as well as push / pull transfers! VC 79

Git advantages 4! Resilience! Speed! Space! No one repository has more data than any other! Very fast operations compared to other VCSs! Compression can be done across the repository, not just per file! Minimizes local size as well as push / pull transfers! Simplicity! Object model is simple! VC 80

Git advantages 5! Resilience! Speed! Space! No one repository has more data than any other! Very fast operations compared to other VCSs! Compression can be done across the repository, not just per file! Minimizes local size as well as push / pull transfers! Simplicity! Object model is simple! Large user base with robust tools! VC 81