Date post: | 14-Aug-2015 |
Category: |
Software |
Upload: | uri-goldstein |
View: | 122 times |
Download: | 1 times |
What is Git?
• A Version Control System like SVN - ONLY BETTER.
• Everything is faster and easier:– Committing.– Reverting.– Branching.– Merging.
• Work disconnected = Offline.
What is GitHub?
• A web-based git hosting service.• Like Assembla, only better. • Uses a simple workflow = GitHub Flow.• Extremely popular.• A community of devs sharing code.
Git – Everyone Gets a Repo
Git Server
TCMW Repository
Uri’s Machine
TCMWWorking
Copy
Lior’s Machine
TCMWWorking
Copy
TCMW Repository
TCMW Repository
“Origin”
GitHubUri’s Machine
Lifecycle of a Change
Staging Area
Local GitRepository
Remote GitRepository
Commit PushC:\dev\MyClass.cs
Stage
Lifecycle of a Change – Cont’d
GitHubLior’s Machine
C:\dev\MyClass.cs
Local GitRepository
Remote GitRepository
Merge Pull
Subversion
• Creating branches takes time.• Commits are big.• SVN stores diffs in repo. • Merging is a pain
Git
• Creating branches is a snap.• Commits are small and frequent.• Git stores full files in repo.• Merging is a joy much less painful.
Master
Branch
Push
Lior’s Feature
Git
Uri’s Feature
Uri’s Bug Fix
Branch
Pull
Push
Branch
Pull
Push
Pull
Pull
GitHub
• Huge online community for open-source projects = Public.
• Huge online service for commercial start-ups and enterprises = PRIVATE.
• Runs Git Flow.
GitHub Flow
• ‘master’ branch is always stable.• Devs use ‘feature’* branches.• Feature branches pull from master freely.• Feature branches merge back to master via
Pull Request = PR.• Pull Request reviewed by peer + auto tests. ‘master’ branch is always stable.
A day in the life 1/2
• Brew a hot cup of coffee.• Pull latest from origin master.• Need to work on new feature • Branch = create new feature branch.• Code and commit in small increments.
• Lunch!
A day in the life 2/2
• Brew a hot cup of coffee.• Pull latest from origin master.• Resolve tiny conflicts easily.• Verify quality with unit/integ. tests.• Submit Pull Request (PR) for review.• Nag reviewers to review.• PR accepted? Verify master green on build server
• Celebrate the day with a drink.
Thank you.
• http://tinyurl.com/gitandgithub
• Git Documentation http://www.git-scm.com/
• Pro Git – Free book http://www.git-scm.com/book/en/v2
• GitHub http://github.com/
• SourceTree – Git Client https://www.sourcetreeapp.com/
• Use Visual Studio with Git https://msdn.microsoft.com/en-us/library/hh850437.aspx