Taking your version control to a next level with TFS and Git

60
Taking your source control to a next level with TFS and Git

description

This are the slides of my Visug (Visual Studio User Group) session about how yo can leverage the power of Git with TFS 2013/Visual Studio online and Visual Studio.

Transcript of Taking your version control to a next level with TFS and Git

Page 1: Taking your version control to a next level with TFS and Git

Taking your source control to a next level

with TFS and Git

Page 2: Taking your version control to a next level with TFS and Git

Alexander Vanwynsberghe

Houthulst

Working @ Cronos

ALM (MVP) and ESN

@Vanwynsberghea

www.alexandervanwynsberghe.be

Who Am I?

Page 3: Taking your version control to a next level with TFS and Git

Source Control

Page 4: Taking your version control to a next level with TFS and Git

Source control inggggggg

ggg gg ggg gg .

ggg gggg gggggg gggggg

ggg gggg ggg gggggggg gg gggggggggg

ggggggggggg gg ggg gg -gggggggggggg

Agenda

Page 5: Taking your version control to a next level with TFS and Git

Source Control Models

Centralized

Distributed

Page 6: Taking your version control to a next level with TFS and Git
Page 7: Taking your version control to a next level with TFS and Git

Back in the old days

Page 8: Taking your version control to a next level with TFS and Git

Prior to TFS

Page 9: Taking your version control to a next level with TFS and Git

“SourceSafe gives you the illusion of safety and control, while exposing

your project to risk”

“SourceSafe teaches developers bad habits like: avoid branching, exclusive

locks, easy permanent deletions”

Codinghorror.com

Page 10: Taking your version control to a next level with TFS and Git

Visual Studio 2005 Team System

Visual Studio 2008 Team System

Visual Studio Team Foundation Server 2010

TFVC

Page 11: Taking your version control to a next level with TFS and Git

Centralized Version Control Systembased on (server) workspaces

Page 12: Taking your version control to a next level with TFS and Git

Add

Pending Change

Check-inHistory

Changeset

Check-out

Check-out lock

Compare

Label

Rollback

Cloak

Shelving

Page 13: Taking your version control to a next level with TFS and Git

Disadvantages

Offline scenario’s

Read-only files

You need Visual Studio (or TEE or the Power Tools for Shell integration)

12

3

Page 14: Taking your version control to a next level with TFS and Git

Server Workspaces

• You talk to TFS when you check-out

• Allows you to do security on check-out

• Visibility at all times into what everyone is doing

• Great for large codebases

Page 15: Taking your version control to a next level with TFS and Git

Visual Studio Team Foundation Server 2012

TFVCLocal Workspaces

V2

Page 16: Taking your version control to a next level with TFS and Git

Centralized Version Control Systembased on (local) workspaces

$TF

Page 17: Taking your version control to a next level with TFS and Git

Local Workspaces

• Default for TFS 2012

• No explicit checkout = easy to edit outside ofVisual Studio or Eclipse

• Get Latest & Check in Compares local cache against the server

• Problematic for large codebases

Page 18: Taking your version control to a next level with TFS and Git

Centralized Version Control

Strengths Best for

Server Workspace

Local Workspace

• Scales to very large codebases

• Fine level permission control

• Allows usage monitoring

• Large integrated codebases

• Control and auditability over source code down to the file level

• Offline editing support

• Easy to edit files outside Visual Studio or Eclipse

• Medium-sized integrated codebases

• A balance of fine-grained control with reduced friction

Conclusion

Page 19: Taking your version control to a next level with TFS and Git

if (number of files > 100,000 ) || (locking = required)) { return “consider server workspace”;}else {

return “consider local workspace”;}

If you really want TFVC

Page 20: Taking your version control to a next level with TFS and Git

Server vs Local Workspaces

Page 21: Taking your version control to a next level with TFS and Git
Page 22: Taking your version control to a next level with TFS and Git

App Architecture: suite of loosely coupled systems

Team: Written by small/discrete and distributed

Platforms: Multiple platforms and dev environments (Windows, iOS, Android)

Open source components

Modern Apps and OSS workflows

Page 23: Taking your version control to a next level with TFS and Git
Page 24: Taking your version control to a next level with TFS and Git

There were 2 players

Git

Page 25: Taking your version control to a next level with TFS and Git
Page 26: Taking your version control to a next level with TFS and Git

Git is the Leading DVCS Tool Adoption of Git is growing exponentially

Git as a Deployment Protocol Used to deploy web applications on many

cloud providers (Windows Azure, Heroku, Facebook)

Git has support across platforms

Git took off

Page 27: Taking your version control to a next level with TFS and Git
Page 28: Taking your version control to a next level with TFS and Git

There were some principles

100% true Git join the community

Page 29: Taking your version control to a next level with TFS and Git
Page 30: Taking your version control to a next level with TFS and Git
Page 31: Taking your version control to a next level with TFS and Git

Team Foundation Server 2013 & Visualstudio.com

Git100%

Visual Studio 2012 (+Tools for Git) & Visual Studio 2013

Page 32: Taking your version control to a next level with TFS and Git

Strengths Best for

Git

DistributedVersion Control

• Full offline experience

• Complete repository with portable history

• Simplified branching model

• Modular codebases

• Integrating with open source

• Highly distributed teams

Page 33: Taking your version control to a next level with TFS and Git

Fully integratedGit support

Team Foundation Server / VisualStudio online

Project 2

Issues

Project

MgmtBuild

Git SCC Provider

Project 1

Issues

Project

MgmtBuild

Git

3rd Party XCode

Eclipse

Shell

3rd Party Eclipse

Shell

… TFVC

……

TFS SCC Provider

Team Explorer

TFVC Object Model

Local Repo

LibGit2 / LibGit2Sharp

Other Remote

Git Repo

Git-TF

Page 34: Taking your version control to a next level with TFS and Git

Team Foundation Server 2013 & Visualstudio.com

Page 35: Taking your version control to a next level with TFS and Git

Web interface

Page 36: Taking your version control to a next level with TFS and Git

Migration & Web Interface

Page 37: Taking your version control to a next level with TFS and Git

for dummies

Page 38: Taking your version control to a next level with TFS and Git

initclonecommit

fetchpullpush

Page 39: Taking your version control to a next level with TFS and Git

Git TFVCcommit /

push check-in

fetch get-latest

pullget-latest +

merge

Page 40: Taking your version control to a next level with TFS and Git

Super Simple Git Workflowfor the lone wolf

init/clone

add

commit

push

Staged

To a remote

Page 41: Taking your version control to a next level with TFS and Git

Super Simple TeamWorkflowfor the hyper agile team

init/clone

add/commit

pull

push

Page 42: Taking your version control to a next level with TFS and Git

Feature BranchesShort lived, Isolated Sandboxes

init/clone

branch checkout

add/commit

checkout

merge

push

Page 43: Taking your version control to a next level with TFS and Git
Page 44: Taking your version control to a next level with TFS and Git

Clone the code

Page 45: Taking your version control to a next level with TFS and Git

Push the modifications

Page 46: Taking your version control to a next level with TFS and Git

Everything is synchronized

Page 47: Taking your version control to a next level with TFS and Git

Branches

Page 48: Taking your version control to a next level with TFS and Git

Using Git with Visual Studio

Page 49: Taking your version control to a next level with TFS and Git

TFS Build, Deployment & Cross-platform

Page 50: Taking your version control to a next level with TFS and Git

TFS Build

Page 51: Taking your version control to a next level with TFS and Git

Deployment protocol

Page 52: Taking your version control to a next level with TFS and Git

Cross-platform

TEE EGit

Page 53: Taking your version control to a next level with TFS and Git

TFS Build + Cross-platform

Page 54: Taking your version control to a next level with TFS and Git
Page 55: Taking your version control to a next level with TFS and Git

Enterprise class support

Ease of installationSupport and servicingEase of managementIntegrated AuthenticationEnhanced permissionsALM Integration

Page 56: Taking your version control to a next level with TFS and Git

I want to.. In Visual Studio? Command promptGet information about your local repository (such as the remotes you are tracking)

If the repository is in a TFS team project, then yes. Otherwise, no.

git-remote

Apply a tag to a commitNo, but you can view them.

You can use the command prompt to push, edit, and remove tags.

Create or edit a note NoYou can use the command prompt to push, edit, and remove notes

Amend your last commit No git-commit

Undo a committed change by applying the inverse of the commit.

No git-revert

Re-order history or combine (squash) commits.

No Rebasing

Page 57: Taking your version control to a next level with TFS and Git

Team Foundation Version Control

Git(hosted by TFS)

Page 58: Taking your version control to a next level with TFS and Git

When to Pick

TFVC• Developers familiar with

Centralized version control

• Highly coupled codebase

• Tight audit/control requirements

• Use of MyWork + Code Review

Git• Developers want to use it

• Using tools with built-in Git support

• XCode / iOS Development

Page 59: Taking your version control to a next level with TFS and Git

Remember

Source Control is only a part of an ALM

solution!

Page 60: Taking your version control to a next level with TFS and Git

Thanks!Vanwynsbergheawww.alexandervanwynsberghe.be