SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Monitor your servers for free with Quest Spotlight Cloud.
24/7 operational monitoring
for up to 5 SQL Servers.
Mobile dashboard for
iOS and Android, too.
Totally free! BrentOzar.com/go/spotlight
Save the Date!
2019
June 9-14
We’re back in Orlando!
www.SQLintersection.com
Leave the every day behind and enter a world of wonder and enchantment at the Walt Disney World® Resort.
Located in the heart of the most magical place on earth, the Walt Disney World Swan and Dolphin Resort
provides a truly extraordinary backdrop for our event! Beautiful tropical landscaping, tranquil waterways,
and classic art and architecture work together to create a stunning landmark!
SQLintersection
Session: Wednesday, 9:45am-11:00am
An Introduction to GitHub (for DBAs)
BrentOzar.com/go/githubfordbas
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
2010-current: consulting DBA
08-10: MCM, Quest Software
05-08: DBA, VM, SAN admin
99-05: dev, architect, DBA
Still today: source control n00b
www.BrentOzar.com
Help@BrentOzar.com
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
2010-current: consulting DBA
08-10: MCM, Quest Software
05-08: DBA, VM, SAN admin
99-05: dev, architect, DBA
Still today: source control n00b
www.BrentOzar.com
Help@BrentOzar.com
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Distributed source control is really intimidating: branches, pull requests,
merges - will somebody just take my code, for crying out loud? Why does it
have to be so complicated and involved?
I'm with you: I'm Brent Ozar, and I hated GitHub. For years, I struggled with it,
but I've come to a gradual truce. I'm not a GitHub pro by any means, but in
the span of one session, I can explain the most important terms to you in a
way that'll make sense for non-developers. I'll show you how to contribute to
someone else's open source project, and how to get started putting your own
scripts under source control.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
What we’re gonna do
Understand where distributed source control comes from, and its language
Open an issue with something we want to fix in sp_Blitz
Contribute that change, and see how the management looks
Contribute an improvement to someone else’s repo
Keep it simple: use the official GitHub client and a text editor
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
What we’re NOT gonna do
Debate the differences between Git, GitHub, GitLab, etc.
Move projects from TFS to GitHub
Create GitHub.com accounts and walk through installing the Github tools
Debate the merits of different client tools (I’ll use the official one)
Type things at the command line
Build continuous integration or continuous deployment
Keep your SQL Server in sync with source control
End the war between tabs and spaces
Solve a merge conflict
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
When I was your age…
10
11
12
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Times changed. Developers faced new problems.
Open source happened:
people wanted to collaborate on the same files at the same time.
The Internet happened:
collaborators were spread globally, and not employees of a company.
Linux happened:
people wanted to collaborate on BIG files, and a lot of them,
and they wanted to work on big changes over time.
13
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Distributed version control became popular.
 2005: Linus Torvalds creates Git to solve those problems.
 2008: GitHub.com launched as a hosting company to run Git for you
(and make their own improvements.)
 2010s: GitHub became the dominant source-control-as-a-service.
 2012: we put sp_Blitz & FRK in there (because they’re code, not data.)
 2018: Microsoft acquired GitHub for $7.5B.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
GitHub is designed for code, not databases.
 It’s designed for collaboration across company lines, not single users.
 It’s designed by developers, for developers
(and initially on Linux first, so cross-platform support is great.)
 It’s great for units of code that can be entirely overwritten.
(Great example: a stored procedure.)
 Because it’s a developer tool, IDEs
(VS, VS Code, text editors) integrate it.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Let’s contribute a change to sp_BlitzLock.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
The thing I wanna fix
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Here’s the spot in the code
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Where the code lives: FirstResponderKit.org
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Terms
 GitHub account: owned by a person or organization
 Repository: an application’s source code, owned by an account
 Branch: a version of a repository
 Master branch: always ready for customer deployments
 Dev branch: the next candidate for master, but maybe not ready yet
 Issue branches: kinda like opening the dev branch and clicking File, Save As, and having a
separate space to work without bothering other developers
 Commit: backing up your local code up to your branch (GitHub, cloud)
 Pull request: asking the dev maintainer to “pull” your code into a branch
 Issue: bug or feature request. Discussion is normal here.
22
23
Changes have happened
in this branch lately.
I need to pull them down
to my local computer.
I haven’t made
any changes.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Wanna make a change? Make a branch.
 Master branch: always ready for deployments.
 Development branch: the next candidate to become master.
 Where we’ll work:
 Create an issue describing what we wanna do
 Create a branch with a name that points to that issue
24
26
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
It’s a lot of work, but it pays off for team projects.
Check out the “Blame” and “History” buttons…
27
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
“Blame”
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Working in someone else’s repo…
32
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Terms
 GitHub account: owned by a person or organization
 Repository: an application’s source code, owned by an account
 Fork: a copy of a repository, copied into your own account
 If you want to work on someone else’s repository, you either have to:
 Get them to give you permissions in their repo (very unlikely), or
 Fork their repository into your own account, and work on it in your account
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Forks can be controversial.
 1995: MySQL AB, private company
 2008: Sun Microsystems bought MySQL AB
(but MySQL was still open source)
 2009: a MySQL founder forked (save-as) the MySQL open source code
and started a “new” database called MariaDB
 2010: Oracle bought Sun (and inherited MySQL - but still open source)
 2012: MariaDB Foundation started, keeping MariaDB open source
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
But forks keep open source projects safe.
 Anyone can fork a repo at any time, without permission
 If the original maintainer does something stupid, you still have the code
 (Although that by itself doesn’t grant you legal rights to do stuff)
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Understand the license you’re working with
 Most repos have a license.md file in their repo with the exact license
 First Responder Kit, DBAtools, Ola Hallengren: MIT License, open source
 VS Code, Azure Data Studio: source code is MIT, but the binaries aren’t
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Back to our simple example
 The sqlcollaborative owns the dbatools repository, and I don’t want
to ask for permissions from that team
 I need to fork the dbatools repository to my own account
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
What I should really do:
 For the dbatools repository to my own account
 Make a branch for the work I want to do
(even in my own account – because when I love a project, I may end
up making several contributions, and they may not all get accepted
at the same time)
 Do my work locally, then commit it (to my branch)
 Send a pull request to the sqlcollaborative
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
That probably doesn’t seem elegant.
 “Why do I have to clone somebody else’s repo to my own account?”
 “Can’t I just ask for permissions in their repo, and edit it live?”
 “What’s the benefit of all this complexity?”
It wasn’t designed for tiny projects.
It was designed for big ones like…
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
There have been 9,437 changes
to SQL Server Books Online
since my client updated.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Lessons I learned the hard way
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
What’s still hard
 Source control for binary files (Excel, PowerBI, Word files)
 Conflict resolution (I’ve been known to nuke my files and start over, or
copy/paste them out into other folders and discard my changes)
 Source control for databases:
 Schema (table structure, indexes)
 Data (configuration rows)
 Machine configuration (trace flags, server settings)
 Integration between Github and SQL Server tools: SSMS, ADS
 Red Gate SQL Source Control: ~$500 per user, integrates with SSMS
 Microsoft Azure Data Studio: new query-writing tool, based on VS Code
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Developers are ahead of us.
Development tools & text editors have more GitHub integration.
Because of that, when doing work on code saved in GitHub,
I’m more likely to use developer tools that make source control easier.
For example, my favorite Mac text editor (TextMate) automatically shows
when I’m editing a file in a GitHub repo, plus what branch I’m in:
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Learn Markdown.
Like Word, but with plain text
Useful in Github, Stack Overflow, and
just general note-taking apps
Cheat sheets:
MarkdownGuide.org
MarkdownTutorial.org
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Be polite, upbeat, and thankful.
 Read a project’s contributing guide before jumping in.
 Maintainers are often doing this as a hobby or a labor of love.
 Take time and really test things before you ask a question or try to
contribute code: the maintainer is usually a volunteer.
 They’re doing you a favor by sharing their work. Be thankful.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Filing a bug, issue, or feature request
 Open source doesn’t mean free contractors.
 If you’re passionate enough to help out with code,
read the project’s contributing guide,
and then open an issue talking about what you’d like to contribute.
 Other people will discuss the thing you want to add – sometimes it’s
not a good fit for the project, or they have input that may change the
way you want to write the code.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Branching guidelines
 Never work in the master or dev branches directly.
 Create new branches off the dev branch.
 Name your branch with the issue number you’re working on.
 Commit often. It’s like taking a backup.
(However, maintainers may ask you to “squash” your commits.)
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Don’t learn from Microsoft repos.
Microsoft has invested a TON in their repos like:
 Making it easier to contribute to Books Online pages
 Automating code review notifications and license acceptance
But no other repos offer that level of tooling.
Don’t think that the way Microsoft repos work
is the way all other repos work. It’s not even close.
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Recap, next steps, and your career
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
The most important terms
 GitHub account: owned by a person or organization
 Repository: an application’s source code, owned by an account
 Fork: copying someone else’s repo into your account (and it’s fine!)
 Branch: a version of a repository
 Master branch: always ready for customer deployments
 Dev branch: the next candidate for master, but maybe not ready yet
 Issue branches: kinda like opening the dev branch and clicking File, Save As, and having a
separate space to work without bothering other developers
 Commit: backing up your local code up to your branch (GitHub, cloud)
 Pull request: asking the dev maintainer to “pull” your code into a branch
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Next steps: BrentOzar.com/go/githubfordbas
 Official resources:
 GitHub’s training videos: https://www.youtube.com/githubguides
 Lab exercises: https://lab.github.com/githubtraining/introduction-to-github
 The documentation, kinda like Books Online: https://help.github.com/
 Really big picture: jobs, maintainers, conduct: https://opensource.guide/
 Popular repos:
 First Responder Kit: http://FirstResponderKit.org
 DBAtools (PowerShell): https://dbatools.io/
 Microsoft SQL Server docs: https://github.com/MicrosoftDocs/sql-docs
 Finding more cool stuff: Hacker News: https://news.ycombinator.com/
52
© SQLintersection. All rights reserved.
http://www.SQLintersection.com
Your Github profile
is a verified resume.
53
54
Monitor your servers for free with Quest Spotlight Cloud.
24/7 operational monitoring
for up to 5 SQL Servers.
Mobile dashboard for
iOS and Android, too.
Totally free! BrentOzar.com/go/spotlight

Weitere ähnliche Inhalte

Was ist angesagt?

ReactDC Intro to NextJS 9
ReactDC Intro to NextJS 9ReactDC Intro to NextJS 9
ReactDC Intro to NextJS 9Allison Kunz
 
Low maintenance perl notes
Low maintenance perl notesLow maintenance perl notes
Low maintenance perl notesPerrin Harkins
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressOtto Kekäläinen
 
What’s New in ASP.NET 4
What’s New in ASP.NET 4What’s New in ASP.NET 4
What’s New in ASP.NET 4Todd Anglin
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8Derek Jacoby
 
How I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPressHow I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPressChris Jean
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Matt Raible
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10Derek Jacoby
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...Otto Kekäläinen
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & Youjskulski
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeColdFusionConference
 
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLHTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLUlf Wendel
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeededm00se
 
Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...
Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...
Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...Ezra Gildesgame
 
State of the resource timing api
State of the resource timing apiState of the resource timing api
State of the resource timing apiAaron Peters
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 BoilerplateMichael Enslow
 

Was ist angesagt? (20)

ReactDC Intro to NextJS 9
ReactDC Intro to NextJS 9ReactDC Intro to NextJS 9
ReactDC Intro to NextJS 9
 
Low maintenance perl notes
Low maintenance perl notesLow maintenance perl notes
Low maintenance perl notes
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPress
 
What’s New in ASP.NET 4
What’s New in ASP.NET 4What’s New in ASP.NET 4
What’s New in ASP.NET 4
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Untangling7
Untangling7Untangling7
Untangling7
 
How I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPressHow I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPress
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10
 
Pantheon basics
Pantheon basicsPantheon basics
Pantheon basics
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & You
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio Code
 
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLHTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...
Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...
Understanding XHProf: Pinpointing Why Your Site is Slow and How to Fix it - S...
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
State of the resource timing api
State of the resource timing apiState of the resource timing api
State of the resource timing api
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 Boilerplate
 

Ähnlich wie An Introduction to GitHub for DBAs - Brent Ozar

Boilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development ProcessBoilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development ProcessFibonalabs
 
DevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation SlidesDevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation SlidesFab L
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...DevSecCon
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersYoav Avrahami
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on RailsViridians
 
Pain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakPain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakSigma Software
 
ASP.NET Core and Docker
ASP.NET Core and DockerASP.NET Core and Docker
ASP.NET Core and DockerChuck Megivern
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Slobodan Lohja
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopMark Rackley
 
Rapidly Building and Deploying Scalable Web Architectures
Rapidly Building and Deploying Scalable Web ArchitecturesRapidly Building and Deploying Scalable Web Architectures
Rapidly Building and Deploying Scalable Web ArchitecturesKeith Fitzgerald
 
Polaris presentation ioc - code conference
Polaris presentation   ioc - code conferencePolaris presentation   ioc - code conference
Polaris presentation ioc - code conferenceSteven Contos
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSRoss Kukulinski
 
How Open Source Embiggens Salesforce.com
How Open Source Embiggens Salesforce.comHow Open Source Embiggens Salesforce.com
How Open Source Embiggens Salesforce.comSalesforce Engineering
 
Light-up-your-out-of-the-box LightSwitch Application
Light-up-your-out-of-the-box LightSwitch ApplicationLight-up-your-out-of-the-box LightSwitch Application
Light-up-your-out-of-the-box LightSwitch ApplicationBoulos Dib
 

Ähnlich wie An Introduction to GitHub for DBAs - Brent Ozar (20)

Boilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development ProcessBoilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development Process
 
Fluxible
FluxibleFluxible
Fluxible
 
DevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation SlidesDevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation Slides
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
 
Os Owens
Os OwensOs Owens
Os Owens
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on Rails
 
Pain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakPain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr Sugak
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
ASP.NET Core and Docker
ASP.NET Core and DockerASP.NET Core and Docker
ASP.NET Core and Docker
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
Rapidly Building and Deploying Scalable Web Architectures
Rapidly Building and Deploying Scalable Web ArchitecturesRapidly Building and Deploying Scalable Web Architectures
Rapidly Building and Deploying Scalable Web Architectures
 
Polaris presentation ioc - code conference
Polaris presentation   ioc - code conferencePolaris presentation   ioc - code conference
Polaris presentation ioc - code conference
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOS
 
How Open Source Embiggens Salesforce.com
How Open Source Embiggens Salesforce.comHow Open Source Embiggens Salesforce.com
How Open Source Embiggens Salesforce.com
 
Web summit.pptx
Web summit.pptxWeb summit.pptx
Web summit.pptx
 
Light-up-your-out-of-the-box LightSwitch Application
Light-up-your-out-of-the-box LightSwitch ApplicationLight-up-your-out-of-the-box LightSwitch Application
Light-up-your-out-of-the-box LightSwitch Application
 

Mehr von Brent Ozar

Fundamentals of TempDB
Fundamentals of TempDBFundamentals of TempDB
Fundamentals of TempDBBrent Ozar
 
Fundamentals of Columnstore - Introductions
Fundamentals of Columnstore - IntroductionsFundamentals of Columnstore - Introductions
Fundamentals of Columnstore - IntroductionsBrent Ozar
 
How to Think Like the SQL Server Engine
How to Think Like the SQL Server EngineHow to Think Like the SQL Server Engine
How to Think Like the SQL Server EngineBrent Ozar
 
SQL Query Optimization: Why Is It So Hard to Get Right?
SQL Query Optimization: Why Is It So Hard to Get Right?SQL Query Optimization: Why Is It So Hard to Get Right?
SQL Query Optimization: Why Is It So Hard to Get Right?Brent Ozar
 
Dynamic SQL: How to Build Fast Multi-Parameter Stored Procedures
Dynamic SQL: How to Build Fast Multi-Parameter Stored ProceduresDynamic SQL: How to Build Fast Multi-Parameter Stored Procedures
Dynamic SQL: How to Build Fast Multi-Parameter Stored ProceduresBrent Ozar
 
Headaches of Blocking, Locking, and Deadlocking
Headaches of Blocking, Locking, and DeadlockingHeadaches of Blocking, Locking, and Deadlocking
Headaches of Blocking, Locking, and DeadlockingBrent Ozar
 
Columnstore Customer Stories 2016 by Sunil Agarwal
Columnstore Customer Stories 2016 by Sunil AgarwalColumnstore Customer Stories 2016 by Sunil Agarwal
Columnstore Customer Stories 2016 by Sunil AgarwalBrent Ozar
 
500-Level Guide to Career Internals
500-Level Guide to Career Internals500-Level Guide to Career Internals
500-Level Guide to Career InternalsBrent Ozar
 
Introduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the EngineIntroduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the EngineBrent Ozar
 
Building a Fast, Reliable SQL Server for kCura Relativity
Building a Fast, Reliable SQL Server for kCura RelativityBuilding a Fast, Reliable SQL Server for kCura Relativity
Building a Fast, Reliable SQL Server for kCura RelativityBrent Ozar
 
How to Make SQL Server Go Faster
How to Make SQL Server Go FasterHow to Make SQL Server Go Faster
How to Make SQL Server Go FasterBrent Ozar
 
500-Level Guide to Career Internals
500-Level Guide to Career Internals500-Level Guide to Career Internals
500-Level Guide to Career InternalsBrent Ozar
 
What I Learned About SQL Server at Ignite 2015
What I Learned About SQL Server at Ignite 2015What I Learned About SQL Server at Ignite 2015
What I Learned About SQL Server at Ignite 2015Brent Ozar
 

Mehr von Brent Ozar (13)

Fundamentals of TempDB
Fundamentals of TempDBFundamentals of TempDB
Fundamentals of TempDB
 
Fundamentals of Columnstore - Introductions
Fundamentals of Columnstore - IntroductionsFundamentals of Columnstore - Introductions
Fundamentals of Columnstore - Introductions
 
How to Think Like the SQL Server Engine
How to Think Like the SQL Server EngineHow to Think Like the SQL Server Engine
How to Think Like the SQL Server Engine
 
SQL Query Optimization: Why Is It So Hard to Get Right?
SQL Query Optimization: Why Is It So Hard to Get Right?SQL Query Optimization: Why Is It So Hard to Get Right?
SQL Query Optimization: Why Is It So Hard to Get Right?
 
Dynamic SQL: How to Build Fast Multi-Parameter Stored Procedures
Dynamic SQL: How to Build Fast Multi-Parameter Stored ProceduresDynamic SQL: How to Build Fast Multi-Parameter Stored Procedures
Dynamic SQL: How to Build Fast Multi-Parameter Stored Procedures
 
Headaches of Blocking, Locking, and Deadlocking
Headaches of Blocking, Locking, and DeadlockingHeadaches of Blocking, Locking, and Deadlocking
Headaches of Blocking, Locking, and Deadlocking
 
Columnstore Customer Stories 2016 by Sunil Agarwal
Columnstore Customer Stories 2016 by Sunil AgarwalColumnstore Customer Stories 2016 by Sunil Agarwal
Columnstore Customer Stories 2016 by Sunil Agarwal
 
500-Level Guide to Career Internals
500-Level Guide to Career Internals500-Level Guide to Career Internals
500-Level Guide to Career Internals
 
Introduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the EngineIntroduction to SQL Server Internals: How to Think Like the Engine
Introduction to SQL Server Internals: How to Think Like the Engine
 
Building a Fast, Reliable SQL Server for kCura Relativity
Building a Fast, Reliable SQL Server for kCura RelativityBuilding a Fast, Reliable SQL Server for kCura Relativity
Building a Fast, Reliable SQL Server for kCura Relativity
 
How to Make SQL Server Go Faster
How to Make SQL Server Go FasterHow to Make SQL Server Go Faster
How to Make SQL Server Go Faster
 
500-Level Guide to Career Internals
500-Level Guide to Career Internals500-Level Guide to Career Internals
500-Level Guide to Career Internals
 
What I Learned About SQL Server at Ignite 2015
What I Learned About SQL Server at Ignite 2015What I Learned About SQL Server at Ignite 2015
What I Learned About SQL Server at Ignite 2015
 

Kürzlich hochgeladen

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Kürzlich hochgeladen (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

An Introduction to GitHub for DBAs - Brent Ozar

  • 1. Monitor your servers for free with Quest Spotlight Cloud. 24/7 operational monitoring for up to 5 SQL Servers. Mobile dashboard for iOS and Android, too. Totally free! BrentOzar.com/go/spotlight
  • 2. Save the Date! 2019 June 9-14 We’re back in Orlando! www.SQLintersection.com Leave the every day behind and enter a world of wonder and enchantment at the Walt Disney World® Resort. Located in the heart of the most magical place on earth, the Walt Disney World Swan and Dolphin Resort provides a truly extraordinary backdrop for our event! Beautiful tropical landscaping, tranquil waterways, and classic art and architecture work together to create a stunning landmark!
  • 3. SQLintersection Session: Wednesday, 9:45am-11:00am An Introduction to GitHub (for DBAs) BrentOzar.com/go/githubfordbas
  • 4. © SQLintersection. All rights reserved. http://www.SQLintersection.com 2010-current: consulting DBA 08-10: MCM, Quest Software 05-08: DBA, VM, SAN admin 99-05: dev, architect, DBA Still today: source control n00b www.BrentOzar.com Help@BrentOzar.com
  • 5. © SQLintersection. All rights reserved. http://www.SQLintersection.com 2010-current: consulting DBA 08-10: MCM, Quest Software 05-08: DBA, VM, SAN admin 99-05: dev, architect, DBA Still today: source control n00b www.BrentOzar.com Help@BrentOzar.com
  • 6. © SQLintersection. All rights reserved. http://www.SQLintersection.com Distributed source control is really intimidating: branches, pull requests, merges - will somebody just take my code, for crying out loud? Why does it have to be so complicated and involved? I'm with you: I'm Brent Ozar, and I hated GitHub. For years, I struggled with it, but I've come to a gradual truce. I'm not a GitHub pro by any means, but in the span of one session, I can explain the most important terms to you in a way that'll make sense for non-developers. I'll show you how to contribute to someone else's open source project, and how to get started putting your own scripts under source control.
  • 7. © SQLintersection. All rights reserved. http://www.SQLintersection.com What we’re gonna do Understand where distributed source control comes from, and its language Open an issue with something we want to fix in sp_Blitz Contribute that change, and see how the management looks Contribute an improvement to someone else’s repo Keep it simple: use the official GitHub client and a text editor
  • 8. © SQLintersection. All rights reserved. http://www.SQLintersection.com What we’re NOT gonna do Debate the differences between Git, GitHub, GitLab, etc. Move projects from TFS to GitHub Create GitHub.com accounts and walk through installing the Github tools Debate the merits of different client tools (I’ll use the official one) Type things at the command line Build continuous integration or continuous deployment Keep your SQL Server in sync with source control End the war between tabs and spaces Solve a merge conflict
  • 9. © SQLintersection. All rights reserved. http://www.SQLintersection.com When I was your age…
  • 10. 10
  • 11. 11
  • 12. 12
  • 13. © SQLintersection. All rights reserved. http://www.SQLintersection.com Times changed. Developers faced new problems. Open source happened: people wanted to collaborate on the same files at the same time. The Internet happened: collaborators were spread globally, and not employees of a company. Linux happened: people wanted to collaborate on BIG files, and a lot of them, and they wanted to work on big changes over time. 13
  • 14. © SQLintersection. All rights reserved. http://www.SQLintersection.com Distributed version control became popular.  2005: Linus Torvalds creates Git to solve those problems.  2008: GitHub.com launched as a hosting company to run Git for you (and make their own improvements.)  2010s: GitHub became the dominant source-control-as-a-service.  2012: we put sp_Blitz & FRK in there (because they’re code, not data.)  2018: Microsoft acquired GitHub for $7.5B.
  • 15. © SQLintersection. All rights reserved. http://www.SQLintersection.com GitHub is designed for code, not databases.  It’s designed for collaboration across company lines, not single users.  It’s designed by developers, for developers (and initially on Linux first, so cross-platform support is great.)  It’s great for units of code that can be entirely overwritten. (Great example: a stored procedure.)  Because it’s a developer tool, IDEs (VS, VS Code, text editors) integrate it.
  • 16. © SQLintersection. All rights reserved. http://www.SQLintersection.com Let’s contribute a change to sp_BlitzLock.
  • 17. © SQLintersection. All rights reserved. http://www.SQLintersection.com The thing I wanna fix
  • 18. © SQLintersection. All rights reserved. http://www.SQLintersection.com Here’s the spot in the code
  • 19. © SQLintersection. All rights reserved. http://www.SQLintersection.com Where the code lives: FirstResponderKit.org
  • 20. © SQLintersection. All rights reserved. http://www.SQLintersection.com Terms  GitHub account: owned by a person or organization  Repository: an application’s source code, owned by an account  Branch: a version of a repository  Master branch: always ready for customer deployments  Dev branch: the next candidate for master, but maybe not ready yet  Issue branches: kinda like opening the dev branch and clicking File, Save As, and having a separate space to work without bothering other developers  Commit: backing up your local code up to your branch (GitHub, cloud)  Pull request: asking the dev maintainer to “pull” your code into a branch  Issue: bug or feature request. Discussion is normal here.
  • 21.
  • 22. 22
  • 23. 23 Changes have happened in this branch lately. I need to pull them down to my local computer. I haven’t made any changes.
  • 24. © SQLintersection. All rights reserved. http://www.SQLintersection.com Wanna make a change? Make a branch.  Master branch: always ready for deployments.  Development branch: the next candidate to become master.  Where we’ll work:  Create an issue describing what we wanna do  Create a branch with a name that points to that issue 24
  • 25.
  • 26. 26
  • 27. © SQLintersection. All rights reserved. http://www.SQLintersection.com It’s a lot of work, but it pays off for team projects. Check out the “Blame” and “History” buttons… 27
  • 28. © SQLintersection. All rights reserved. http://www.SQLintersection.com “Blame”
  • 29.
  • 30. © SQLintersection. All rights reserved. http://www.SQLintersection.com Working in someone else’s repo…
  • 31.
  • 32. 32
  • 33. © SQLintersection. All rights reserved. http://www.SQLintersection.com Terms  GitHub account: owned by a person or organization  Repository: an application’s source code, owned by an account  Fork: a copy of a repository, copied into your own account  If you want to work on someone else’s repository, you either have to:  Get them to give you permissions in their repo (very unlikely), or  Fork their repository into your own account, and work on it in your account
  • 34. © SQLintersection. All rights reserved. http://www.SQLintersection.com Forks can be controversial.  1995: MySQL AB, private company  2008: Sun Microsystems bought MySQL AB (but MySQL was still open source)  2009: a MySQL founder forked (save-as) the MySQL open source code and started a “new” database called MariaDB  2010: Oracle bought Sun (and inherited MySQL - but still open source)  2012: MariaDB Foundation started, keeping MariaDB open source
  • 35. © SQLintersection. All rights reserved. http://www.SQLintersection.com But forks keep open source projects safe.  Anyone can fork a repo at any time, without permission  If the original maintainer does something stupid, you still have the code  (Although that by itself doesn’t grant you legal rights to do stuff)
  • 36. © SQLintersection. All rights reserved. http://www.SQLintersection.com Understand the license you’re working with  Most repos have a license.md file in their repo with the exact license  First Responder Kit, DBAtools, Ola Hallengren: MIT License, open source  VS Code, Azure Data Studio: source code is MIT, but the binaries aren’t
  • 37. © SQLintersection. All rights reserved. http://www.SQLintersection.com Back to our simple example  The sqlcollaborative owns the dbatools repository, and I don’t want to ask for permissions from that team  I need to fork the dbatools repository to my own account
  • 38. © SQLintersection. All rights reserved. http://www.SQLintersection.com What I should really do:  For the dbatools repository to my own account  Make a branch for the work I want to do (even in my own account – because when I love a project, I may end up making several contributions, and they may not all get accepted at the same time)  Do my work locally, then commit it (to my branch)  Send a pull request to the sqlcollaborative
  • 39. © SQLintersection. All rights reserved. http://www.SQLintersection.com That probably doesn’t seem elegant.  “Why do I have to clone somebody else’s repo to my own account?”  “Can’t I just ask for permissions in their repo, and edit it live?”  “What’s the benefit of all this complexity?” It wasn’t designed for tiny projects. It was designed for big ones like…
  • 40. © SQLintersection. All rights reserved. http://www.SQLintersection.com There have been 9,437 changes to SQL Server Books Online since my client updated.
  • 41. © SQLintersection. All rights reserved. http://www.SQLintersection.com Lessons I learned the hard way
  • 42. © SQLintersection. All rights reserved. http://www.SQLintersection.com What’s still hard  Source control for binary files (Excel, PowerBI, Word files)  Conflict resolution (I’ve been known to nuke my files and start over, or copy/paste them out into other folders and discard my changes)  Source control for databases:  Schema (table structure, indexes)  Data (configuration rows)  Machine configuration (trace flags, server settings)  Integration between Github and SQL Server tools: SSMS, ADS  Red Gate SQL Source Control: ~$500 per user, integrates with SSMS  Microsoft Azure Data Studio: new query-writing tool, based on VS Code
  • 43. © SQLintersection. All rights reserved. http://www.SQLintersection.com Developers are ahead of us. Development tools & text editors have more GitHub integration. Because of that, when doing work on code saved in GitHub, I’m more likely to use developer tools that make source control easier. For example, my favorite Mac text editor (TextMate) automatically shows when I’m editing a file in a GitHub repo, plus what branch I’m in:
  • 44. © SQLintersection. All rights reserved. http://www.SQLintersection.com Learn Markdown. Like Word, but with plain text Useful in Github, Stack Overflow, and just general note-taking apps Cheat sheets: MarkdownGuide.org MarkdownTutorial.org
  • 45. © SQLintersection. All rights reserved. http://www.SQLintersection.com Be polite, upbeat, and thankful.  Read a project’s contributing guide before jumping in.  Maintainers are often doing this as a hobby or a labor of love.  Take time and really test things before you ask a question or try to contribute code: the maintainer is usually a volunteer.  They’re doing you a favor by sharing their work. Be thankful.
  • 46. © SQLintersection. All rights reserved. http://www.SQLintersection.com Filing a bug, issue, or feature request  Open source doesn’t mean free contractors.  If you’re passionate enough to help out with code, read the project’s contributing guide, and then open an issue talking about what you’d like to contribute.  Other people will discuss the thing you want to add – sometimes it’s not a good fit for the project, or they have input that may change the way you want to write the code.
  • 47. © SQLintersection. All rights reserved. http://www.SQLintersection.com Branching guidelines  Never work in the master or dev branches directly.  Create new branches off the dev branch.  Name your branch with the issue number you’re working on.  Commit often. It’s like taking a backup. (However, maintainers may ask you to “squash” your commits.)
  • 48. © SQLintersection. All rights reserved. http://www.SQLintersection.com Don’t learn from Microsoft repos. Microsoft has invested a TON in their repos like:  Making it easier to contribute to Books Online pages  Automating code review notifications and license acceptance But no other repos offer that level of tooling. Don’t think that the way Microsoft repos work is the way all other repos work. It’s not even close.
  • 49. © SQLintersection. All rights reserved. http://www.SQLintersection.com Recap, next steps, and your career
  • 50. © SQLintersection. All rights reserved. http://www.SQLintersection.com The most important terms  GitHub account: owned by a person or organization  Repository: an application’s source code, owned by an account  Fork: copying someone else’s repo into your account (and it’s fine!)  Branch: a version of a repository  Master branch: always ready for customer deployments  Dev branch: the next candidate for master, but maybe not ready yet  Issue branches: kinda like opening the dev branch and clicking File, Save As, and having a separate space to work without bothering other developers  Commit: backing up your local code up to your branch (GitHub, cloud)  Pull request: asking the dev maintainer to “pull” your code into a branch
  • 51. © SQLintersection. All rights reserved. http://www.SQLintersection.com Next steps: BrentOzar.com/go/githubfordbas  Official resources:  GitHub’s training videos: https://www.youtube.com/githubguides  Lab exercises: https://lab.github.com/githubtraining/introduction-to-github  The documentation, kinda like Books Online: https://help.github.com/  Really big picture: jobs, maintainers, conduct: https://opensource.guide/  Popular repos:  First Responder Kit: http://FirstResponderKit.org  DBAtools (PowerShell): https://dbatools.io/  Microsoft SQL Server docs: https://github.com/MicrosoftDocs/sql-docs  Finding more cool stuff: Hacker News: https://news.ycombinator.com/
  • 52. 52
  • 53. © SQLintersection. All rights reserved. http://www.SQLintersection.com Your Github profile is a verified resume. 53
  • 54. 54
  • 55. Monitor your servers for free with Quest Spotlight Cloud. 24/7 operational monitoring for up to 5 SQL Servers. Mobile dashboard for iOS and Android, too. Totally free! BrentOzar.com/go/spotlight