Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.

Slides:



Advertisements
Similar presentations
Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
Advertisements

Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
Git Branching What is a branch?. Review: Distributed - Snapshots Files are stored by SHA-1 hash rather than filename Stored in git database in compressed.
om om GIT - Tips & Tricks / git.dvcs git-tips.com
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
Patterns & practices Symposium 2013 Introducing Git version control into your team Mark
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Git: Part 1 Overview & Object Model These slides were largely cut-and-pasted from tutorial/, with some additions.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Fundamentals of Git By Zachary Ling 29 th, Aug,
Version control Using Git 1Version control, using Git.
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Chapter - 2 What is “GIT” VERSION CONTROL AND GIT BASICS.
Git. What’s Git? A British swear A Distributed Version Control System Developed in 2005 by Linus Torvalds for use on the Linux Kernel Git Logo by Jason.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
Introduction to Version Control
Git – versioning and managing your software L. Grewe.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Version Control Systems academy.zariba.com 1. Lecture Content 1.What is Software Configuration Management? 2.Version Control Systems (VCS) 3.Basic Git.
…using Git/Tortoise Git
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Introduction to Version Control with Git CSC/ECE 517, Fall 2014 A joint project of the CSC/ECE 517 staff, including Titus Barik, Gaurav Tungatkar, Govind.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
QUICK START OF GITHUB Lin Shuo-Ren 2013/3/6 1. Why We Should Control The Version Although it rains, throw not away your watering pot. All changes should.
1 © 2015 Albion College | BUGMI 2015 Git’s Architecture And How It Relates to Banner Eddie Bachle Albion College September 25, 2015.
Version Control System Lisa Palathingal 03/04/2015.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
Page 1 TBD 12/08/2014 Formation GIT Laurent Kappel Groupe SII 65, rue de Bercy Paris Tél : Fax :
Falcons Git Usage Andre Pool Version 2.0 October 2015 / Veldhoven.
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
CS 160 and CMPE/SE 131 Software Engineering February 16 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
An Introduction to Git David Johndrow COMP 490 – Senior Design & Development 2/11/16.
It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Introduction to Git - Chirag Dani. Objectives Basics of Git Understanding different “Mindset of Git” Demo - Git with Visual Studio.
Technical Presentation by: David Spano. About Git (VCS) Simple Git Commands Branching Github Git GUI Summary.
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
Backing up a machine with git
GIT: (a)Gentle InTroduction Bruno Bossola. Agenda About version control Concepts Working locally Remote operations Enterprise adoption Q&A.
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
Dr. Tanusri Bhattacharya
CS5220 Advanced Topics in Web Programming Version Control with Git
Introduction to Version Control with Git
4 Version control (part 1)
Version Control Systems
11 Version control (part 2)
LECTURE 2: Software Configuration Management
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
Source Code Management
Version Control with git
LECTURE 3: Software Configuration Management
Version Control System - Git
Version control with Git
Introduction to Version Control with Git
Version/revision control via git
Git Introduction.
Presentation transcript:

Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav Tungatkar

Local version control: RCS Keep many copies of files Error prone RCS stores deltas Version 3 Version 2 Version 1 File check out

Centralized Version Control If you need to work with other programmers … Version 3 Version 2 Version 1 File check out File check out Computer B Computer A

File Server vs. Version-Control Server At first glance, the client- server architecture of a version-control system looks much like a typical file server. So why do we need version control?why do we need version control

File Sharing Issues, 1 Assume your project has 15 developers: –Each developer wants to make 1 change and must communicate this change to all other developers. –What are the total number of interactions that must occur? C(15, 2) = N(N – 1)/2 = 15(14)/2 = 105. That’s a lot of information to track!

File Sharing Issues, 2 Image: Version Control with Subversion The problem is that users are stepping on each other’s feet!

Approach 1: Lock, Modify, Unlock Image: Version Control with Subversion 1.Locking may cause administrative problems. 2.Locking may cause unnecessary serialization. 3.Locking may create a false sense of security.

Approach 2: Copy - Modify-Merge Image: Version Control with Subversion Sounds chaotic, but in practice, runs extremely smoothly. Question: When is locking necessary?

Subversion (SVN) Open source, Apache License. Available on all major operating systems. Improvements such as “cheap” copying and branching, remote options (https), over legacy CVS. However, CVS has more mature tools, and SVN has it own flaws (DVCS).

Answer these questionsAnswer Give one advantage of using a version-control server for source-code management over using a fileserver. Suppose a project has 15 developers and no shared repository. Can you come up with a better way of communicating changes than N(N-1)/2 interactions? Explain how locking can cause administrative problems. Explain how locking can create a false sense of security. With copy- modify-merge, when is locking necessary? Exercise 1

Branches and Tags Trunk: Location where main development occurs. Branches: Location used to isolate changes to another development line (e.g., experimental features). Tags: Snapshot of the content (e.g., RTM, service packs, EOL). Image:

Populated Repository Image: Version Control with Subversion A Subversion repository layout. The folder names are just a convention, and have no special meaning to the repository.

Creating a Branch Image: Version Control with Subversion In Subversion, the underlying mechanism of a branch is implemented by performing a simple directory copy.

Exercise 2 Answer these questions about branches.Answer oSuppose, in fixing a bug, you modify three lines of code in two source files. Should you create a new branch? Why or why not? oWhich would probably be more common, branches or tags? oWhat are some of the risks of copying files in a repository? How do version-control systems minimize this risk?

Distributed Version Control Clients don’t check out individual files; they mirror the repository. What’s the advantage? Version 3 Version 2 Version 1 Version 3 Version 2 Version 1 Version 3 Version 2 Version 1 File Computer AComputer B

Git Came out of the Linux project, in Simple design Strong support for non-linear development (thousands of parallel branches) Fully distributed Able to handle large projects like the Linux kernel efficiently (speed and data size)

Integrity & Checksums Everything checksummed with an SHA-1 hash –40-character string –composed of hex characters –calculated based on the contents of a file or directory structure in Git Example –24b9da aa493b52f8696cd6d3b00373 Git knows everything by hash, not filename

Snapshots, not Diffs See Every time you commit, Git takes a snapshot of your files. Files that have not changed are not copied.   Almost all ops are local browse history commit

3 States of a File in Git Modified Staged Committed working directory staging area git directory (repository) check out the project stage files commit

File Status Lifecycle unmodifiedmodifiedstaged edit the file stage the file untracked add the file remove the file

Checking Status To check the status of your files: $ git status # On branch master nothing to commit (working directory clean) Creating new files $ vim README $ git status # On branch master # Untracked files: # (use "git add..." to include in what will be committed) # # README nothing added to commit but untracked files present (use "git add" to track)

Checking status, cont. Begin to track the file: $ git add README The file is now tracked: $ git status # On branch master # Changes to be committed: # (use "git reset HEAD..." to unstage) # # new file: README # For more info:

Remotes On a project, you may be working with several remote directories. “Origin” is the server you cloned your repository from $ git clone git://github.com/schacon/ticgit.git Initialized empty Git repository in /private/tmp/ticgit/.git/ remote: Counting objects: 595, done. remote: Compressing objects: 100% (269/269), done. remote: Total 595 (delta 255), reused 589 (delta 253) Receiving objects: 100% (595/595), KiB, done. Resolving deltas: 100% (255/255), done. $ cd ticgit $ git remote origin

Pulling, pushing to remote $ git fetch [remote-name] E.g., git fetch origin git push origin master

Common Workflow using Git Centralized workflow … Integration-manager workflow … Common use cases:

Exercise 3 Answer these question about DVCSs.Answer oWhat is an advantage of referring to files and branches by hash, rather than by filename? oCan you think of one disadvantage of a DVCS compared to a centralized VCS?