I don’t git it! Source control management deep dive with tfvc and git Christopher Mank Chief Technologist White Ficus Nathan Lasnoski Chief Technology Officer Concurrency
Christopher Mank Nathan Lasnoski @cmank7 @nlasnoski Microsoft MVP 12+ Years IT 20+ Years IT Swimming Biking, skiing
Source control management
Source control providers
TFVC Team Foundation Version Control (TFVC) “TFS” brand of source control Centralized version control Historical data stored on the server Like checking a book out at the library Server and Local Workspaces Path-based branches
TFVC architecture
TFVC branching
TFVC Demo
git Distributed Code Management Each developer has a copy of the entire codebase with history Because each developer has the codebase, they can work offline Remote locations are used for merge/rebase and deployment
Git
5 Stages of Git
HEAD (big) The current branch. In more detail: Your working tree is normally derived from the state of the tree referred to by HEAD. HEAD is a reference to one of the heads in your repository, except when using a detached HEAD, in which case it directly references an arbitrary commit.
head (head ref) (little) A named reference to the commit at the tip of a branch. Heads are stored in a file in $GIT_DIR/refs/heads/ directory.
Demo
rebase To reapply a series of changes from a branch to a different base, and reset the head of that branch to the result.
fetch Fetching a branch means to get the branch’s head ref from a remote repository, to find out which objects are missing from the local object database, and to get them, too. See also git-fetch(1).
pull Pulling a branch means to fetch it and merge it. See also git-pull(1).
push Pushing a branch means to get the branch’s head ref from a remote repository, find out if it is a direct ancestor to the branch’s local head ref, and in that case, putting all objects, which are reachable from the local head ref, and which are missing from the remote repository, into the remote object database, and updating the remote head ref. If the remote head is not an ancestor to the local head, the push fails..
Pull request (manage technical debt!)
Demo
.gitignore A gitignore file specifies intentionally untracked files that Git should ignore.
Import tfvc to git
Demo
submodule A repository that holds the history of a separate project inside another repository (the latter of which is called superproject).
index A collection of files with stat information, whose contents are stored as objects. The index is a stored version of your working tree. Truth be told, it can also contain a second, and even a third version of a working tree, which are used when merging.
graph
SourceTree
Git Virtual File System (GVFS) GVFS stands for Git Virtual File System. GVFS virtualizes the file system beneath your git repo so that git and all tools see a fully hydrated repo, but GVFS only downloads objects as they are needed. GVFS also manages git's sparse-checkout to ensure that git operations like status, checkout, etc., can be as quick as possible.
Git branching
Tfvc or git
Tfvc or git TFVC Git Large files (Although GVFS will eliminate this) Seasoned developer knowledge Centralized (History, branching, large code base) Git Tools and features Support Younger developer knowledge Industry and Microsoft standard Distributed (History, branching, smaller code base) (Popular) Object database (One copy of code base)
Tfvc or git
Tfvc or git So, TFVC or Git? If I had to pick… Both work great and enable DevOps Both do nearly the same things, but in different ways If I had to pick… Version Control Guidance (ALM Rangers) The right version control for you
Appendix Git “git help glossary” SourceTree gitignore templates Git in Visual Studio Scaling Git GVFS Import repo from TFVC to Git ALM Rangers Git Branching