SlideShare a Scribd company logo
Introduction to Git Administration
For New Administrators
Shawn Doyle
ReleaseTEAM Inc
sdoyle@releaseteam.com
www.linkedin.com/in/releaseteam/
http://twitter.com/ReleaseTEAMInc
Premium SCM Consulting firm since 1999
Focus on Software Configuration Management
On site and remote consulting services
– Build Automation
– CM tool administration, customization, upgrades, migrations
Classroom training / hands-on mentoring
R
e
l
e
a
s
e
T
E
ClearCase ClearQuest Jenkins
Git RTC Build Forge
SVN Jira Electric Commander
Shawn Doyle - ReleaseTEAM
Introduction to git administration
 For the administrator new to Git
 An overview of Git
 Workflows
 Common admin tasks
 Access control
 Triggers
 Stories from the trenches
Subversion & Git Presentation
Agenda
Slide 4
So you now are a Git Admin
Git has sprung up in many organizations. Spreading like
a wild fire from the development groups.
– Developers want less restrictions to their productivity
– SCM is always seen as a restriction and rarely a necessary one
SCM admins are finding they need to support Git
regardless of existing corporate standards.
SCM admins need to find a way to control the chaos.
Most commercial SCM tools now support Git as a client.
Don’t panic Git is fun, powerful and it is the future.
Subversion & Git Presentation
Wait.. What? how did this happen
Slide 6
DVCS
– Learn the difference
Users
– Training
– Indulging the Git promoter(s)
Many solutions to common problems
– Authentication
– Workflows
– Multiple available UIs
Cleaning up after user mistakes
Subversion & Git Presentation
What am I in for?
Slide 7
1. RTFM http://git-scm.com/book
2. Now that you read the Git book, go thru these tutorials
3. Watch these videos - Google Tech Talks
Linus Torvalds on git
Randal Schwartz on Git
4. RTFW
https://git.wiki.kernel.org/index.php/Main_Page
5. Create a repo and start playing!
Subversion & Git Presentation
How I learned Git
Slide 8
Tutorials
http://try.github.io/levels/1/challenges/1 Code School
https://www.atlassian.com/git/tutorial/git-basics Atlassian's Git tutorial
http://gitready.com/ Git Ready
https://www.kernel.org/pub/software/scm/git/docs/everyday.html
Everyday GIT With 20 Commands Or So
Videos - Google Tech Talks
http://www.youtube.com/watch?v=4XpnKHJAok8 Linus Torvalds
http://www.youtube.com/watch?v=8dhZ9BXQgc4 Randal Schwartz
Wiki
https://git.wiki.kernel.org/index.php/GitCommunity|Git Community Wiki
Subversion & Git Presentation
Resources
Slide 9
Git Overview
Subversion & Git Presentation Slide 10
When coming from another SCM system to Git you need
to shift how you think about how version control works.
In a more classic SCM you think of it as a system that
versions files in a tree or directory structure.
Git is better thought of as a system that versions trees of
files.
Biggest Obstacle
Stores whole copies of the repo
– No file deltas
– Entire tree is captured at each commit not just the files that
changed, a snapshot of the repo
Branches and tags
– Are pointers to commits
– Very fast and light weight
Subversion & Git Presentation
How Git Works
Slide 12
Git is:
– Powerful
– Complex
– Fast (local)
– worthy contender to replace many commercial tools
– the solution you are looking for
Object Storage
– Blobs
– SHA1s or hashes
– Trees
Perl like syntax
– ^ $ ~ …
Subversion & Git Presentation
Not Scared yet?
Slide 13
Workflows
Centralized
– Central repository
Feature Branch
– Central repository + branching per features
Gitflow
– Branches per features, releases and bug fixes
Forking
– Distributed workflow
Workflows
Uses a central repository
– single point-of-entry for all changes
– Everyone clones from the central repo
– Everyone pull/pushes from the same repo
Benefits
– SCM Admin can put controls/triggers on the central repo
– Security can be setup using tools like
• Stash
• Gitolite
• Gitosis
– SCM Builds and Deploys can be maintained from a clone of the
central repo.
Centralized
Development of features in isolated branches
– Allows features to be developed independently
As a feature is finished it is merged to the master branch
Subversion & Git Presentation
Feature Branch
Slide 17
Branches are focused around releases
Branches are also used for
– Release
– Integration or Test
– Features
Strict rules on how and when branches interact
Subversion & Git Presentation
Gitflow
Slide 18
Repos are forked per developer
– Developers work in isolation
One Repo is declared as the Official Repo
– A Project Maintainer integrates the Repos
– Developers sync with the Official Repo
Subversion & Git Presentation
Forking
Slide 19
Common Admin Tasks
What to Migrate? Snapshot in time or all history?
– Push for converting a snapshot in time
– If that fails, then try for a few key slices
– Arguments
• Why burden the new repo with all the history
• Populating new workspaces will take longer
• Leave old SCM system in a locked down state for reference
– Refactoring
• Always a good time to refactor when switching SCM system
• Can cause headaches if under deadlines
– Builds
• How dependent were you on the old SCM for builds
– Paths
– Build tools (e.g. clearmake)
– APIs, Libs
Migration Considerations
Client and Server concepts
Use a Client side hook for actions
– Commit
– Merge
– Rebase
Server Hooks
– Notification
– Rejecting Pushes
Hooks need to be copied to the repos
– Hooks are not part of cloning
– Hooks do not get updated with pull/pushes
In general, use hooks in Git to encourage workflow or for
notifications. Do not rely on them to enforce security
Subversion & Git Presentation
Hooks
Slide 22
Be Clever
– There is no one way to provide Security
– There is no single definition of Security
SSH keys
Git Repository Management
– Stash
– Gitolite
– Github
Triggers
Subversion & Git Presentation
Security
Slide 23
Sometimes a user removed something they didn’t mean
to.
The following commands are your friends when trying to
figure out what to restore and from where.
– Git log
– Git relog
– Git reset
– Git update-ref
Repos for backups
– Create clones on a safe network disk
– Pull to them once a day (or once a week)
– Use them to recover files or as a reference
Subversion & Git Presentation
Recovering files
Slide 24
Stories from the trenches
Builds failed after migrating a project from ClearCase to
Git
– Dev group certain the migration to Git had failed
– Build depended on a large number of sub directories to exist
– Git does not add empty directories
• It needs a blob to point to a directory for the directory to exist.
– Solution was to initially add the missing directories
• Created .temp files in each empty dir
• This creates a blob and the directory is added to Git
– Long term solution
• Encourage them to fix their build Ant/Make files.
Empty Directories
A user added multiple large files to his repo
– Then committed them and pushed them to the central repo
User removed them with ‘git rm –rf’
Why is this bad?
– Clone commands went from seconds to 20 minutes
Why?
– Git didn’t remove the large files from the initial commit
– Clone copies the entire repo locally, those files while no longer
visible are still copied
Solution
– Git filter-branch
– Git gc
– Git prune
Subversion & Git Presentation
Slow Clones
Slide 27
Client Requirements
– Contractors limited to sub dirs.
– All files in a single Repo.
Git by design
– Does not preserve directory permissions
– Hooks run before or after a Git command
– Submodules don’t offer additional protections
• Also broke the client single repo requirement
Subversion & Git Presentation
Directory Isolation
Slide 28
Client workflow depended on Tags
Git Tags are not shared by default
– Tags need to be explicitly;
• Pushed to the remote
• Pulled locally
Solutions
– Reevaluate Workflow
– Share pull command with Tag name
– Share Hash
Subversion & Git Presentation
Universal Tags
Slide 29
Client wanted to control who could create a local repo
– Git is not designed to do this
You can limit who can clone from a central Repo
– Stash/Gitolite
– SSH Keys
Once a Repo is cloned
– Nothing is stopping the user from cloning it again
– They can allow others to clone
Solution
– Lock down who can push back to the central Repo
Subversion & Git Presentation
Controlling local repos
Slide 30
Client wants to Clone one subdir of a Repo
– Build requires entire Repo
– Deploy requires one sub dir
– Build happens weeks before the deploy
– Deploy wants a fresh Repo
• Just build results and deployment script
Solution
– Submodules
Subversion & Git Presentation
Partial Clone
Slide 31
Questions
Shawn Doyle
ReleaseTEAM Inc
sdoyle@releaseteam.com
www.linkedin.com/in/releaseteam/
http://twitter.com/ReleaseTEAMInc

More Related Content

What's hot (20)

KEY
The everyday developer's guide to version control with Git
E Carter
 
PDF
Learning git
Sid Anand
 
PPT
Git workflows
Xpand IT
 
PPT
Git vs SVN
neuros
 
PPTX
Git and github
Sayantika Banik
 
PDF
Dealing with Merge Conflicts in Git
gittower
 
PPTX
Git One Day Training Notes
glen_a_smith
 
PPTX
Versioning avec Git
Jean-Baptiste Vigneron
 
PPTX
Git basics to advance with diagrams
Dilum Navanjana
 
PPTX
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
PDF
초보자를 위한 Git & GitHub
Yurim Jin
 
PPTX
Git - Basic Crash Course
Nilay Binjola
 
PPTX
Git 101 for Beginners
Anurag Upadhaya
 
PPTX
Introduction git
Dian Sigit Prastowo
 
PDF
How Netflix Tunes EC2 Instances for Performance
Brendan Gregg
 
PPTX
Source control
Sachithra Gayan
 
PDF
Git Introduction Tutorial
Thomas Rausch
 
PDF
Git for beginners
Arulmurugan Rajaraman
 
PDF
Git and git flow
Fran García
 
PDF
Using GitLab CI
ColCh
 
The everyday developer's guide to version control with Git
E Carter
 
Learning git
Sid Anand
 
Git workflows
Xpand IT
 
Git vs SVN
neuros
 
Git and github
Sayantika Banik
 
Dealing with Merge Conflicts in Git
gittower
 
Git One Day Training Notes
glen_a_smith
 
Versioning avec Git
Jean-Baptiste Vigneron
 
Git basics to advance with diagrams
Dilum Navanjana
 
Introduction to Gitlab | Gitlab 101 | Training Session
Anwarul Islam
 
초보자를 위한 Git & GitHub
Yurim Jin
 
Git - Basic Crash Course
Nilay Binjola
 
Git 101 for Beginners
Anurag Upadhaya
 
Introduction git
Dian Sigit Prastowo
 
How Netflix Tunes EC2 Instances for Performance
Brendan Gregg
 
Source control
Sachithra Gayan
 
Git Introduction Tutorial
Thomas Rausch
 
Git for beginners
Arulmurugan Rajaraman
 
Git and git flow
Fran García
 
Using GitLab CI
ColCh
 

Viewers also liked (14)

PDF
Undoing Things in Git
gittower
 
PDF
Getting Git Right
Sven Peters
 
PDF
Architecting IT to enable business success
BSGAfrica
 
PPT
Subversion Admin
rchakra
 
PDF
Git & Github for beginners
Paulo Henrique Nonaka
 
PDF
Seven Ineffective Coding Habits of Many Programmers
Kevlin Henney
 
PDF
Git Tutorial 教學
Wen-Tien Chang
 
PDF
Git workflows
Sergiu Savva
 
PDF
Git Ready! Workflows
Atlassian
 
PPTX
My Git workflow
Rui Carvalho
 
PPTX
Git workflows
Thuc Le Dong
 
PPTX
Why Aren't You Using Git Flow?
John Congdon
 
PDF
Git Branching Model
Lemi Orhan Ergin
 
Undoing Things in Git
gittower
 
Getting Git Right
Sven Peters
 
Architecting IT to enable business success
BSGAfrica
 
Subversion Admin
rchakra
 
Git & Github for beginners
Paulo Henrique Nonaka
 
Seven Ineffective Coding Habits of Many Programmers
Kevlin Henney
 
Git Tutorial 教學
Wen-Tien Chang
 
Git workflows
Sergiu Savva
 
Git Ready! Workflows
Atlassian
 
My Git workflow
Rui Carvalho
 
Git workflows
Thuc Le Dong
 
Why Aren't You Using Git Flow?
John Congdon
 
Git Branching Model
Lemi Orhan Ergin
 
Ad

Similar to Introduction to git administration (20)

PPTX
Introduction to git & github
Vinothini KadambavanaSundaram
 
PPTX
Workflows using Git GitHub | Edureka
Edureka!
 
PPTX
Lets git to it
Yoram Michaeli
 
PPTX
git presentation
Belal Quamar
 
PPTX
Git essential training & sharing self
Chen-Tien Tsai
 
PDF
Git workshop
Reslan Al Tinawi
 
PPTX
Introduction to GitHub, Open Source and Tech Article
PRIYATHAMDARISI
 
PPTX
Git and Markdown.pptx
Richard Anton
 
PDF
Git introduction for Beginners
MortezaTaghaddomi
 
PPT
Fundamentals and basics of Git and commands
DivyanshGupta922023
 
PDF
Git interview questions | Edureka
Edureka!
 
PPT
3 Git
Fabio Fumarola
 
PPTX
Git from the trenches
Nuno Caneco
 
PDF
Git Gerrit Mit Teamforge
CollabNet
 
PPTX
finall_(1).pptx
meseret akalu
 
PPTX
2015-ghci-presentation-git_gerritJenkins_final
Mythri P K
 
PDF
Git and github - Verson Control for the Modern Developer
John Stevenson
 
PPTX
Open Source_Git.pptx
Muhammad Sohail
 
PDF
Git/Gerrit with TeamForge
CollabNet
 
PPTX
Git presentation to some coworkers some time ago
Rodrigo Urubatan
 
Introduction to git & github
Vinothini KadambavanaSundaram
 
Workflows using Git GitHub | Edureka
Edureka!
 
Lets git to it
Yoram Michaeli
 
git presentation
Belal Quamar
 
Git essential training & sharing self
Chen-Tien Tsai
 
Git workshop
Reslan Al Tinawi
 
Introduction to GitHub, Open Source and Tech Article
PRIYATHAMDARISI
 
Git and Markdown.pptx
Richard Anton
 
Git introduction for Beginners
MortezaTaghaddomi
 
Fundamentals and basics of Git and commands
DivyanshGupta922023
 
Git interview questions | Edureka
Edureka!
 
Git from the trenches
Nuno Caneco
 
Git Gerrit Mit Teamforge
CollabNet
 
finall_(1).pptx
meseret akalu
 
2015-ghci-presentation-git_gerritJenkins_final
Mythri P K
 
Git and github - Verson Control for the Modern Developer
John Stevenson
 
Open Source_Git.pptx
Muhammad Sohail
 
Git/Gerrit with TeamForge
CollabNet
 
Git presentation to some coworkers some time ago
Rodrigo Urubatan
 
Ad

Recently uploaded (20)

PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 

Introduction to git administration

  • 1. Introduction to Git Administration For New Administrators Shawn Doyle ReleaseTEAM Inc [email protected] www.linkedin.com/in/releaseteam/ http://twitter.com/ReleaseTEAMInc
  • 2. Premium SCM Consulting firm since 1999 Focus on Software Configuration Management On site and remote consulting services – Build Automation – CM tool administration, customization, upgrades, migrations Classroom training / hands-on mentoring R e l e a s e T E ClearCase ClearQuest Jenkins Git RTC Build Forge SVN Jira Electric Commander Shawn Doyle - ReleaseTEAM
  • 4.  For the administrator new to Git  An overview of Git  Workflows  Common admin tasks  Access control  Triggers  Stories from the trenches Subversion & Git Presentation Agenda Slide 4
  • 5. So you now are a Git Admin
  • 6. Git has sprung up in many organizations. Spreading like a wild fire from the development groups. – Developers want less restrictions to their productivity – SCM is always seen as a restriction and rarely a necessary one SCM admins are finding they need to support Git regardless of existing corporate standards. SCM admins need to find a way to control the chaos. Most commercial SCM tools now support Git as a client. Don’t panic Git is fun, powerful and it is the future. Subversion & Git Presentation Wait.. What? how did this happen Slide 6
  • 7. DVCS – Learn the difference Users – Training – Indulging the Git promoter(s) Many solutions to common problems – Authentication – Workflows – Multiple available UIs Cleaning up after user mistakes Subversion & Git Presentation What am I in for? Slide 7
  • 8. 1. RTFM http://git-scm.com/book 2. Now that you read the Git book, go thru these tutorials 3. Watch these videos - Google Tech Talks Linus Torvalds on git Randal Schwartz on Git 4. RTFW https://git.wiki.kernel.org/index.php/Main_Page 5. Create a repo and start playing! Subversion & Git Presentation How I learned Git Slide 8
  • 9. Tutorials http://try.github.io/levels/1/challenges/1 Code School https://www.atlassian.com/git/tutorial/git-basics Atlassian's Git tutorial http://gitready.com/ Git Ready https://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So Videos - Google Tech Talks http://www.youtube.com/watch?v=4XpnKHJAok8 Linus Torvalds http://www.youtube.com/watch?v=8dhZ9BXQgc4 Randal Schwartz Wiki https://git.wiki.kernel.org/index.php/GitCommunity|Git Community Wiki Subversion & Git Presentation Resources Slide 9
  • 10. Git Overview Subversion & Git Presentation Slide 10
  • 11. When coming from another SCM system to Git you need to shift how you think about how version control works. In a more classic SCM you think of it as a system that versions files in a tree or directory structure. Git is better thought of as a system that versions trees of files. Biggest Obstacle
  • 12. Stores whole copies of the repo – No file deltas – Entire tree is captured at each commit not just the files that changed, a snapshot of the repo Branches and tags – Are pointers to commits – Very fast and light weight Subversion & Git Presentation How Git Works Slide 12
  • 13. Git is: – Powerful – Complex – Fast (local) – worthy contender to replace many commercial tools – the solution you are looking for Object Storage – Blobs – SHA1s or hashes – Trees Perl like syntax – ^ $ ~ … Subversion & Git Presentation Not Scared yet? Slide 13
  • 15. Centralized – Central repository Feature Branch – Central repository + branching per features Gitflow – Branches per features, releases and bug fixes Forking – Distributed workflow Workflows
  • 16. Uses a central repository – single point-of-entry for all changes – Everyone clones from the central repo – Everyone pull/pushes from the same repo Benefits – SCM Admin can put controls/triggers on the central repo – Security can be setup using tools like • Stash • Gitolite • Gitosis – SCM Builds and Deploys can be maintained from a clone of the central repo. Centralized
  • 17. Development of features in isolated branches – Allows features to be developed independently As a feature is finished it is merged to the master branch Subversion & Git Presentation Feature Branch Slide 17
  • 18. Branches are focused around releases Branches are also used for – Release – Integration or Test – Features Strict rules on how and when branches interact Subversion & Git Presentation Gitflow Slide 18
  • 19. Repos are forked per developer – Developers work in isolation One Repo is declared as the Official Repo – A Project Maintainer integrates the Repos – Developers sync with the Official Repo Subversion & Git Presentation Forking Slide 19
  • 21. What to Migrate? Snapshot in time or all history? – Push for converting a snapshot in time – If that fails, then try for a few key slices – Arguments • Why burden the new repo with all the history • Populating new workspaces will take longer • Leave old SCM system in a locked down state for reference – Refactoring • Always a good time to refactor when switching SCM system • Can cause headaches if under deadlines – Builds • How dependent were you on the old SCM for builds – Paths – Build tools (e.g. clearmake) – APIs, Libs Migration Considerations
  • 22. Client and Server concepts Use a Client side hook for actions – Commit – Merge – Rebase Server Hooks – Notification – Rejecting Pushes Hooks need to be copied to the repos – Hooks are not part of cloning – Hooks do not get updated with pull/pushes In general, use hooks in Git to encourage workflow or for notifications. Do not rely on them to enforce security Subversion & Git Presentation Hooks Slide 22
  • 23. Be Clever – There is no one way to provide Security – There is no single definition of Security SSH keys Git Repository Management – Stash – Gitolite – Github Triggers Subversion & Git Presentation Security Slide 23
  • 24. Sometimes a user removed something they didn’t mean to. The following commands are your friends when trying to figure out what to restore and from where. – Git log – Git relog – Git reset – Git update-ref Repos for backups – Create clones on a safe network disk – Pull to them once a day (or once a week) – Use them to recover files or as a reference Subversion & Git Presentation Recovering files Slide 24
  • 25. Stories from the trenches
  • 26. Builds failed after migrating a project from ClearCase to Git – Dev group certain the migration to Git had failed – Build depended on a large number of sub directories to exist – Git does not add empty directories • It needs a blob to point to a directory for the directory to exist. – Solution was to initially add the missing directories • Created .temp files in each empty dir • This creates a blob and the directory is added to Git – Long term solution • Encourage them to fix their build Ant/Make files. Empty Directories
  • 27. A user added multiple large files to his repo – Then committed them and pushed them to the central repo User removed them with ‘git rm –rf’ Why is this bad? – Clone commands went from seconds to 20 minutes Why? – Git didn’t remove the large files from the initial commit – Clone copies the entire repo locally, those files while no longer visible are still copied Solution – Git filter-branch – Git gc – Git prune Subversion & Git Presentation Slow Clones Slide 27
  • 28. Client Requirements – Contractors limited to sub dirs. – All files in a single Repo. Git by design – Does not preserve directory permissions – Hooks run before or after a Git command – Submodules don’t offer additional protections • Also broke the client single repo requirement Subversion & Git Presentation Directory Isolation Slide 28
  • 29. Client workflow depended on Tags Git Tags are not shared by default – Tags need to be explicitly; • Pushed to the remote • Pulled locally Solutions – Reevaluate Workflow – Share pull command with Tag name – Share Hash Subversion & Git Presentation Universal Tags Slide 29
  • 30. Client wanted to control who could create a local repo – Git is not designed to do this You can limit who can clone from a central Repo – Stash/Gitolite – SSH Keys Once a Repo is cloned – Nothing is stopping the user from cloning it again – They can allow others to clone Solution – Lock down who can push back to the central Repo Subversion & Git Presentation Controlling local repos Slide 30
  • 31. Client wants to Clone one subdir of a Repo – Build requires entire Repo – Deploy requires one sub dir – Build happens weeks before the deploy – Deploy wants a fresh Repo • Just build results and deployment script Solution – Submodules Subversion & Git Presentation Partial Clone Slide 31