Git is a distributed version control system where everyone has the full history and changes can be shared without a central server. It allows developers to easily create branches to work independently and merge changes together. The demo illustrates how branches are just "sticky notes" that can be switched quickly without losing work, and changes are merged by moving the notes. Branches can be short-lived for isolated work or long-lived for multi-version development, with conventions needed to define shared branches. Git enables flexible collaboration both locally and through remote repositories.
2. About me
Callon Campbell
Full-stack developer / technical lead. With over 19 years of
experience developing desktop, mobile and web enterprise
applications using Microsoft .NET Framework, SQL Server and
Azure technologies.
Co-founder of ReflectSoftware Inc and one the principle developers
of ReflectInsight, a real-time .NET logging/analytics framework and
Live/Log Viewer.
2
Email: CallonCampbell@Outlook.com Twitter: @Flying_Maverick, @DevelopAzure
Blog: TheFlyingMaverick.com LinkedIn: LinkedIn.com/in/calloncampbell
Website: ReflectInsight.com
3. Introduction
“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.”
5. What is Git?
Git is a distributed version control system - local
"switching branches just works"
"single folder for all branches"
"switching branches will alter your file system"
6. Distributed
Everyone has a complete history of every check-in, branches…everything
Everything is done offline (except for pulling or pushing which is done online)
No central repository
Changes can be shared without a server
7. Demo
“mkdir CoolProject” -> Make a directory
“cd CoolProject” -> Navigate to directory
“git init” -> This will create a .git hidden folder. This is where
all the magic happens
“notepad README.md” -> save file
“git add .” -> adds all files and folders in directory
“git commit –m ‘my first commit’” -> Check-in to local
repository
Initialization
8. Branching
Git allows you to re-write history!
Forget what you know from your central version control system (SVN, TFS, Perforce)
Git branch is a “sticky note” on a graph node
All branch work takes place within the same folder within your file system
When you switch branches you are moving the “sticky note”
13. Switch branches and is quick and easy
NOTE: Changes will happen to file system and you will think you’ve lost your work…relax…the .git folder is taking care of your
changes
20. Summary of Branching
Quick and easy to create 'feature branches'
Local branches are very powerful
Creating branches are light and can be deleted anytime
Rebase is not scary
22. Sharing Commits – Remote Repos
Better way to share commits is to setup a Remote repos, which is another perk of the
distributed model
23. 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
24. Push
Pushes your changes upstream
Git will reject pushes if newer changes exist
◦ Good practice: pull then push
25. Short vs Long-Lived Branches
Local branches are short lived
Staying off master keeps merges simple
Enables working on several changes at once
Create -> Commit -> Merge -> Delete
26. Short vs Long-Lived Branches
Great for multi-version work
Follow same rules as Master…Story branches
Integrate frequently
Pushed to Remotes (share with everyone)
33. Review of 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?
34. Deploying with Git
Developer "FTP"
Additional branches pointing at:
◦ Test, Staging, Production
Post Commit Hooks Automate deployments
35. What if your organization uses TFS?
Use Git-TF
Local workflow with Git
Push to TFS as a Remote
Multi-Platform and Open Source
http://gittf.codeplex.com