Sofia Event Center 14-15 May 2014 Martin Kulov Git For TFS Developers.

Post on 18-Jan-2016

216 views 0 download

Tags:

transcript

Sofia Event Center

14-15 May 2014

Martin Kulov

Git For TFS Developers

Centralized VCS

• CVS• Subversion• Perforce• Vault• ClearCase• Visual SourceSafe• Team Foundation Version Control

Distributed VCS

• Mercurial• BitKeeper• Fossil• Bazaar• Git

Centralized vs Distributed VCS• “master” vs “blessed” copy• “online” vs “offline” history• “expensive” vs “cheap”

branching• diffs vs snapshots

Git in TFS and VSO

• Supports every Git client• OSS implementation, not Microsoft one• Available in Visual Studio Online• Also in Team Foundation Server 2013• Enterprise features

Enterprise Git

• Easy installation and management• Support• High availability and scale• Integration authentication• Enhanced permissions• ALM integration• Localization

Git in Visual Studio

• Create, clone repo• Push, pull, sync• Branching• Work Item linking• Simplified history

Installing Git

• http://msysgit.github.io/

The “perfect” Git environment• Chocolatey

• cinst PoshGit• cinst Git-Credential-Winstore

• Enable TFS alternate credentials

Configuring Git

• git config --global user.name "Your Name"

• git config --global user.email "Your Email“

• .gitignore

Installing Git demo

Git commands (1)

• init (“disconnected”)• clone (“connected”)

• add, commit (“local”)• push, pull, fetch

(“remote”)

• status• log• gitk --all

Git basics

• Full history is downloaded• History contains commits• Each commit is a snapshot, not a

diff• Checksums are calculated• Operations are local• Three states• Working folder• Index (staged)

Git states

• tracked• modified• staged

Creating repo demo

Anatomy of a commit

• Author• Committer• Date• Message• Parent

commit(s)

f46b2

92da127d72

a72c2

time

Branches

• Pointer to a commit• Stay local unless explicit push• Easy to create and delete• Remotes are read-only• HEAD is another pointer

f46b2

92da127d72

a72c2

time

origin

feature1

master *

Git commands (2)

• remote

• branch, checkout, merge

• rebase

Working with branches demo

Changing history

• git rebase• Change commit’s parent

Centralized Workflow

• One central repo• Dev team push and pull from it• git pull --rebase origin master

Centralized workflow demo

Links

• git-scm.com/book• www.atlassian.com/git/• Microsoft Virtual Academy

– Using Git with Visual Studio 2013

Questions???Share your feedback for this particular sessionand for the overall conference experience at

http://aka.ms/intouchfor a chance to win our prizes!