Patterns & practices Symposium 2013 Introducing Git version control into your team Mark

Slides:



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

Version Control CS440 – Introduction to Software Engineering © 2014 – John Bell Based on slides prepared by Jason Leigh for CS 340 University.
Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
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
Introduction to Git and Github Joshua imtraum.com.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Version control Using Git 1Version control, using Git.
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.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
Git – versioning and managing your software L. Grewe.
GIT An introduction to GIT Source Control. What is GIT (1 of 2) ▪ “Git is a free and open source distributed version control system designed to handle.
1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
Version control Using Git Version control, using Git1.
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
Lokesh Puppala. Introduction  Git - Distributed version control system  Initiated by Linus Torvalds  Strongly influenced by Linux kernel development.
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.
Gotta get Git Chris Sherwood and Alfredo Aretxabaleta USGS Woods Hole.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
1 GIT NOUN \’GIT\ A DISTRIBUTED REVISION CONTROL AND SOURCE CODE MANAGEMENT (SCM) SYSTEM WITH AN EMPHASIS ON SPEED. INITIALLY DESIGNED AND DEVELOPED BY.
Version Control Systems. Version Control Manage changes to software code – Preserve history – Facilitate multiple users / versions.
Sofia Event Center May 2014 Martin Kulov Git For TFS Developers.
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.
© 2015 by Herb Holyst Introduction to git Cytomics Workshop December, 2015.
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.
Introduction to Git - Chirag Dani. Objectives Basics of Git Understanding different “Mindset of Git” Demo - Git with Visual Studio.
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Jun-Ru Chang Introduction GIT Jun-Ru Chang
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
Version Control Systems
CS5220 Advanced Topics in Web Programming Version Control with Git
4 Version control (part 1)
Source Control Systems
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
11 Version control (part 2)
Git Practice walkthrough.
Version control, using Git
Git for Visual Studio Developers MARTIN KULOV, ASE
CS5220 Advanced Topics in Web Programming Version Control with Git
SU Development Forum Introduction to Git - Save your projects!
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
SIG: Open Week 1: GitHub Tim Choh.
Source Code Repository
Git CS Fall 2018.
Version Control System - Git
Paul S Waters Getting Git.
GitHub and Git.
Git Fundamentals.
Hop Aboard the Git Train – Transitioning from TFVC
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
Presentation transcript:

patterns & practices Symposium 2013 Introducing Git version control into your team Mark

Symposium 2013 Abstract Over the last several years one of the biggest changes in how developers collaborate with each other has come through, of all things, their source control system. The adoption of Git has changed many of the patterns of software development. In this talk I will introduce you to the core concepts of using Git within a team, how it can improve your agility and communication.

Symposium 2013 Agenda  Introduction  What is Git?  Git 101  Enabling Team Development  Short vs. Long Lived Branches  Deploying with Git  Your Org uses TFS?  Tools/Resources

WHO AM I? Mark Groves Principal Program Manager Developer Division

History

Created by Linus Torvalds for work on the Linux kernel ~2005

History Created by Linus Torvalds for work on the Linux kernel ~2005 Some of the companies that use git:

What is Git?

Git is a Distributed Version Control System

OROR

Git is a Content Management System

Git is a history storage system

Git is a content tracker

How ever you think about it…

Distributed Everyone has the complete history

Distributed Everything is done offline …except push/pull Everyone has the complete history

Distributed Everything is done offline Everyone has the complete history No central authority …except by convention

Distributed Everything is done offline Everyone has the complete history No central authority Changes can be shared without a server

Centralized VC vs. Distributed VC Central Server Remote Server

Branching

Forget what you know from Central VC (…TFS, SVN, Perforce...)

Branching Forget what you know from Central VC Git branch is “Sticky Note” on a graph node

Branching Forget what you know from Central VC Git branch is “Sticky Note” on a graph node All branch work takes place within the same folder within your file system.

Branching Forget what you know from Central VC Git branch is “Sticky Note” on the graph All branch work takes place within the same folder within your file system. When you switch branches you are moving the “Sticky Note”

Initialization C:\> mkdir CoolProject C:\> cd CoolProject C:\CoolProject > git init Initialized empty Git repository in C:/CoolProject/.git C:\CoolProject > notepad README.txt C:\CoolProject > git add. C:\CoolProject > git commit -m 'my first commit' [master (root-commit) 7106a52] my first commit 1 file changed, 1 insertion(+) create mode README.txt

Branches Illustrated master A > git commit –m ‘my first commit’

Branches Illustrated master > git commit (x2) ABC

Branches Illustrated bug123 master > git checkout –b bug123 ABC

Branches Illustrated master > git commit (x2) ABC DE bug123

Branches Illustrated master > git checkout master ABC DE bug123

Branches Illustrated bug123 master > git merge bug123 ABCDE

Branches Illustrated master > git branch -d bug123 ABCDE

Branches Illustrated master ABCDE FG bug456

Branches Illustrated master ABCDE FG bug456 > git checkout master

Branches Illustrated master ABCDE FG > git merge bug456 H bug456

Branches Illustrated master ABCDE FG > git branch -d bug456 H

Branches Illustrated master ABCDE FG bug456

Branches Illustrated master ABCDE > git rebase master F’ G’ bug456

Branches Illustrated master ABCDE > git checkout master > git merge bug456 > git checkout master > git merge bug456 F’ G’ bug456

Branching Review

Quick and Easy to create ‘Feature’ Branches

Branching Review Local branches are very powerful Quick and Easy to create ‘Feature’ Branches

Branching Review Local branches are very powerful Quick and Easy to create ‘Feature’ Branches Rebase is not scary

Software is a Team Sport

Sharing commits My Local Repo Tom’s Repo Tracey’s Repo Matt’s Repo AB C ABCABC ABC

Adding a Remote

Sharing commits My Local Repo Tom’s Repo Tracey’s Repo Matt’s Repo AB C ABCABC ABC Remote Repo A A B B C C D D D D D D

Setting up a Remote

Adding a remote to an existing local repo C:\CoolProject > git remote add origin C:\CoolProject > git remote -v origin (fetch) origin (push)

Setting up a Remote Clone will auto setup the remote C:\> git clone Cloning into 'coolproject'... remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. C:\> cd.\coolproject C:\CoolProject> git remote -v origin (fetch) origin (push)

Setting up a Remote Name remotes what you want

Setting up a Remote Name remotes what you want Origin is only a convention

Branches Illustrated A master BCDE bug123

Branches Illustrated A master origin/master BCDE bug123

Branches Illustrated A B B C C D D E E master bug123 origin/master

Branches Illustrated A B B C C D D E E master bug123 F F G G origin/master

Branches Illustrated A B B C C D D E E master bug123 > git checkout master origin/master

Branches Illustrated A B B C C D D E E master bug123 FG > git pull origin origin/master

Pull = Fetch + Merge Fetch - updates your local copy of the remote branch Pull essentially does a fetch and then runs the merge in one step.

Branches Illustrated A B B C C D D E E master bug123 FG origin/master

Branches Illustrated A B B C C D D E E master bug123 FG > git checkout bug123 origin/master

Branches Illustrated A B’ C’ D’ E’ master bug123 FG > git rebase master origin/master

Branches Illustrated A B’ C’ D’ E’ master bug123 FG > git checkout master origin/master

Branches Illustrated A master bug123 FG > git merge bug123 B’ C’ D’ E’ origin/master

Branches Illustrated A master FG > git push origin B’ C’ D’ E’ bug123 origin/master

Push Pushes your changes upstream Git will reject pushes if newer changes exist on remote. Good practice: Pull then Push

Branches Illustrated A master FG B’ C’ D’ E’ bug123 origin/master

Branches Illustrated A master FG > git branch -d bug123 B’ C’ D’ E’ origin/master

Adding a Remote Review Adding a remote makes it easy to share Pulling from the remote often helps keep you up to date

Short vs. Long-Lived Branches Local branches are short lived

Short vs. Long-Lived Branches Local branches are short lived Staying off master keeps merges simple

Short vs. Long-Lived Branches Local branches are short lived Staying off master keeps merges simple Enables working on several changes at once

Short vs. Long-Lived Branches Local branches are short lived Staying off master keeps merges simple Enables working on several changes at once CreateCommitMerge Delete

Short vs. Long-Lived Branches Great for multi-version work

Short vs. Long-Lived Branches Great for multi-version work Follow same rules as Master

Short vs. Long-Lived Branches Great for multi-version work Follow same rules as Master…Story branches

Short vs. Long-Lived Branches Great for multi-version work Follow same rules as Master…Story branches Integrate frequently

Short vs. Long-Lived Branches Great for multi-version work Follow same rules as Master…Story branches Integrate frequently Pushed to Remotes

Branches Illustrated E master origin/master

Branches Illustrated E master origin/master develop > git branch develop

Branches Illustrated E master origin/master develop > git push origin develop origin/develop

Branches Illustrated E master origin/master develop > git checkout develop origin/develop

Branches Illustrated E master origin/master F F G G develop origin/develop

Branches Illustrated E master origin/master FG develop origin/develop > git pull origin develop

Branches Illustrated E master origin/master FG develop origin/develop > git checkout –b idea idea

Branches Illustrated E master origin/master FG develop origin/develop > git commit idea H

Branches Illustrated E origin/master FG origin/develop idea H I I master develop

Branches Illustrated E origin/master FG origin/develop idea H master develop > git pull (at least daily) I

Branches Illustrated E origin/master FG origin/develop idea H master > git checkout develop I develop

Branches Illustrated E origin/master FG origin/develop idea H master > git merge idea (fast forward merge) I develop

Branches Illustrated E origin/master FG origin/develop H master > git branch –d idea I develop

Branches Illustrated E origin/master FG origin/develop H master > git push origin develop I develop

Merge Flow vs. Rebase Flow E origin/master FG origin/develop H master > git push origin develop I develop

Branches Illustrated – Merge Flow E origin/master FG origin/develop H master > git checkout master I develop

Branches Illustrated – Merge Flow E origin/master FG origin/develop H master > git merge develop I develop J

Branches Illustrated – Merge Flow E origin/master FG origin/develop H master > git push origin I develop J

Branches Illustrated – Rebase Flow E origin/master FG origin/develop H master > git checkout master I develop

Branches Illustrated – Rebase Flow E origin/master FG origin/develop H master > git rebase develop I’ develop I I

Branches Illustrated – Rebase Flow E origin/master FG origin/develop H master > git push origin I’ develop

Rebase Flow E origin/master FG origin/develop H master I’ develop E origin/master FG origin/develop H master I develop J Merge Flow

Short vs. Long-Lived Branches Great for multi-version work Follow same rules as Master …use Story branches Define your conventions What branches do you want to share? Branch per environment?

Deploying with Git

Developer “FTP”

Deploying with Git Developer “FTP” Additional Branches pointing at:

Deploying with Git Developer FTP Additional Branches pointing at: Test, Staging, Production

Deploying with Git Developer FTP Additional Branches pointing at: Test, Staging, Production Post Commit Hooks Automate deployments

Cloud Providers – Git Support AppHarbor Heroku Nodejitsu Windows Azure … to name a few

Simple Azure Deploy

C:\CoolProject > git remote add azure C:\CoolProject > git remote -v azure (fetch) azure (push) origin (fetch) origin (push) C:\CoolProject > git push azure master Counting objects: 3, done. Writing objects: 100% (3/3), 226 bytes, done. Total 3 (delta 0), reused 0 (delta 0) remote: New deployment received. remote: Updating branch 'master'. remote: Updating submodules. remote: Preparing deployment for commit id '7106a52771'. remote: Preparing files for deployment. remote: Deployment successful. To * [new branch] master -> master

Git Deployment Simple workflow

Git Deployment Simple workflow Add Hooks to deploy on Commit

Git Deployment Simple workflow Add Hooks to deploy on Commit Can get more advanced

Git Deployment Simple workflow Add Hooks to deploy on Commit Can get more advanced Add Build machines, push on success

Your Org uses TFS?

Your Org uses TFS? Sure Use Git- TF Local workflow with Git

Your Org uses TFS? Sure Use Git- TF Local workflow with Git Push to TFS as a Remote

Your Org uses TFS? Sure Use Git- TF Local workflow with Git Push to TFS as a Remote Multi-Platform and Open Source

Your Org uses TFS? Sure Use Git- TF Local workflow with Git Push to TFS as a Remote Multi-Platform and Open Source

Individual Developer Workflow C:\CoolProject > git tf clone $/TeamProjectA/Main Make changes to the file in the Git repo C:\CoolProject > git commit -a -m "commit one" (commit changes locally) Make more changes C:\CoolProject > git commit -a -m "commit two" C:\CoolProject > git tf pull --rebase C:\CoolProject > git tf checkin

Git-TF for larger teams TFS Tom’s Repo Tracey’s Repo Matt’s Repo ABCABC ABC Shared Git Repo A A B B C C git tf clone git push git clone

Git-TF Local workflow with Git Push to TFS as a Remote Multi-Platform and Open Source

Tools / Resources Pro Git (Book) TortoiseGit (with TortoiseMerge) Msysgit (includes git-bash) Posh-Git (for PowerShell users) GitScc (Visual Studio integration) Windows Git Credential Store GitHub for Windows

Symposium 2013