introduction to git

33
Introduction to Git Daniel Mann Senior Software Development Consultant InCycle Software New York Seattle Montreal

Upload: incyclesoftware

Post on 13-Feb-2017

176 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Introduction to Git

Introduction to Git

Daniel Mann

Senior Software Development Consultant

InCycle Software

New York ▪ Seattle ▪ Montreal

Page 2: Introduction to Git

Agenda

What is Git?

Overview of Centralized vs Distributed Version Control

Git in Visual Studio / TFS

Is It Right For Me?

Page 3: Introduction to Git

What is Git?

- Distributed version control system

- Designed for the challenges of large-scale open-source projects

- Supports fast, off-line work

Page 4: Introduction to Git

Centralized Version Control

One central code repository

Requires a connection to perform most operations Check out

Commit

Merge

Branch

View History

Can retrieve just the files you need

Limited capability for offline work

Conceptually simple

Page 5: Introduction to Git

Distributed Version Control

No central code repository Central repository is defined by convention

Does not require a connection

Can only retrieve an entire repository

Higher learning curve

Page 6: Introduction to Git

Centralized vs. Distributed

Central Server

Source Code

Files FilesFiles PC 1 PC 2 PC 3

Repo

Remote Server

Repo

Repo Repo

Page 7: Introduction to Git

Remote Server

Repo

PC 1

Repo

Distributed Version Control

Clone

Page 8: Introduction to Git

Distributed Version Control

PC 1

Repository

Change 1

Change 2

Page 9: Introduction to Git

Distributed Version Control

PC 1

Repository Commit

Branch

Merge

etcChange 1

Change 2My Change

Page 10: Introduction to Git

Distributed Version Control

PC 1

Repository

Remote Server

Repo

Pull Remote Changes

Change 1

Change 2Change 3

Change 1

Change 2My Change

Change 3

Change 1

Change 2My Change

Change 3

Page 11: Introduction to Git

Distributed Version Control

PC 1

Repository

Remote Server

Repo

Merge remote changes

with local changesChange 1

Change 2My Change

Change 3

Change 1

Change 2Change 3

Change 1

Change 2My Change

Change 3

Change 4

Page 12: Introduction to Git

Distributed Version Control

PC 1

Repository

Remote Server

RepoChange 1

Change 2Change 3

Change 1

Change 2My Change

Change 3

Change 4

Push Local ChangesMy ChangeChange 4

Change 1

Change 2My Change

Change 3

Change 4

Page 13: Introduction to Git

Why Distributed?

Work fully offline

Encourages frequent commits

Easy to switch work

Powerful tools for viewing and rewriting history

Increasingly popular

Page 14: Introduction to Git

Why Not Distributed?

Harder to use day-to-day

Few non-OSS projects need the ability to rewrite history

Git does not handle binaries well

Security is defined at the repository level

Page 15: Introduction to Git

Git in Visual Studio

Works regardless

of your Git provider

…even against local repos.

Page 16: Introduction to Git

Team Explorer

Page 17: Introduction to Git

Team Explorer

Page 18: Introduction to Git

Team Explorer

Page 19: Introduction to Git

Team Explorer

Page 20: Introduction to Git

First-class IDE support

Page 21: Introduction to Git

Git in TFS

Git and TFVC in the same project One TFVC repository

Unlimited Git repository

Page 22: Introduction to Git

Repository management

Page 23: Introduction to Git

Web-based history

Page 24: Introduction to Git

Web-based history

Page 25: Introduction to Git

Code review via pull requests

Page 26: Introduction to Git

Enforce quality via branch policies

Page 27: Introduction to Git

Branch Policies Required automated build

Page 28: Introduction to Git

Branch Policies Enforce requirement linking

Page 29: Introduction to Git

Branch Policies Enforce code review

Page 30: Introduction to Git

Should you make the switch?

Yes, if:

- You work offline frequently

- Your software is open-source

- You want to branch and merge frequently

Page 31: Introduction to Git

Should you make the switch?

No, if:

- You never work offline

- Your software is closed-source

- Developers are productive and happy using something else

- You require stringent code security

Page 32: Introduction to Git

Best Practices Don’t Panic

Do not put binaries in Git repositories!

Manage binary dependencies via a package manager

Keep repos small (one repo == one application)

Branch early, branch often. Don’t work directly on master.

Read the Docs!

Page 33: Introduction to Git

/InCycleSoftware @InCycleSoftware /company/incycle-software incyclesoftware.com/blog/

Get started with Git!For course/workshops overviews, see links below:

Course: Git Fundamentals –http://incyclesoftware.com/course-git-fundamentals/

Course: Git in Team Foundation Server & Visual Studio -http://incyclesoftware.com/course-git-in-team-foundation-server-visual-studio/

Workshop: Git Migration–http://incyclesoftware.com/workshop-git-migration/

To schedule a course or workshop, email us at [email protected] or call 1-800-565-0510