introduction to git
TRANSCRIPT
![Page 1: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/1.jpg)
Introduction to Git
Daniel Mann
Senior Software Development Consultant
InCycle Software
New York ▪ Seattle ▪ Montreal
![Page 2: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/2.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/3.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/4.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/5.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/6.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/7.jpg)
Remote Server
Repo
PC 1
Repo
Distributed Version Control
Clone
![Page 8: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/8.jpg)
Distributed Version Control
PC 1
Repository
Change 1
Change 2
![Page 9: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/9.jpg)
Distributed Version Control
PC 1
Repository Commit
Branch
Merge
etcChange 1
Change 2My Change
![Page 10: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/10.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/11.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/12.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/13.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/14.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/15.jpg)
Git in Visual Studio
Works regardless
of your Git provider
…even against local repos.
![Page 16: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/16.jpg)
Team Explorer
![Page 17: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/17.jpg)
Team Explorer
![Page 18: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/18.jpg)
Team Explorer
![Page 19: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/19.jpg)
Team Explorer
![Page 20: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/20.jpg)
First-class IDE support
![Page 21: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/21.jpg)
Git in TFS
Git and TFVC in the same project One TFVC repository
Unlimited Git repository
![Page 22: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/22.jpg)
Repository management
![Page 23: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/23.jpg)
Web-based history
![Page 24: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/24.jpg)
Web-based history
![Page 25: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/25.jpg)
Code review via pull requests
![Page 26: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/26.jpg)
Enforce quality via branch policies
![Page 27: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/27.jpg)
Branch Policies Required automated build
![Page 28: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/28.jpg)
Branch Policies Enforce requirement linking
![Page 29: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/29.jpg)
Branch Policies Enforce code review
![Page 30: Introduction to Git](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/30.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/31.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/32.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022021918/58a1b05e1a28ab537c8b46ab/html5/thumbnails/33.jpg)
/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