Gi Git t Fu Fund ndam amen enta tals ls Open up a world of community and collaboration Paul Broadwith @pauby https://blog.pauby.com
Who Am I? Paul Broadwith, Glasgow, Scotland • 25+ years in defence, government, financial • sectors Lead Engineer on Boxstarter and Chocolatey • cChoco DSC Resource
Qu Questio ions A At Th The En End? d?
In This Session • What actually is Git? • What tools do I need for Git? • Who is using Git and why do I need to use it? • How does Git work? • Git commands you need to know! • What is a Pull Request and what they are used for; • How to work with Open Source projects using Git;
Who Is This Aimed At? Level 100
is not GitHub Git
What at Is Is G Git it?
What Is Git? Wikipedia defines Git as: Gi Git is a vers rsion ion cont ntro rol l system for r tra racking ing cha hang nges es in n comput puter er file les s and coordinating work on those files among multiple people. It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files. As a distributed revision control system it is aimed med at spe peed, d, data int ntegrit grity, and support for distributed, non-linear workflows. • https://en.wikipedia.org/wiki/Git
What Is Git? Which means Git is: Git t is a version sion cont ntrol ol sys ystem tem for tracking king cha hang nges es in co n compu puter ter files. es. It It is aimed ed at spe peed ed and nd da data int ntegrity. egrity.
What Is Git? Wikipedia defines Version Control System as: … vers rsion ion cont ntro rol l is the he ma mana nage gement ment of cha hang nges s to docume uments nts, , comput puter er pro rograms, rams, larg rge e web sites, , and nd othe her r coll llecti ction ons s of inf nfor ormat mation ion. . Cha hang nges es are re us usua ually ly identi ntifie fied d by a num number r or r letter r code, term rmed the he "revision number“ … Each revision is associated with a a time mestamp tamp and nd the he pe pers rson on making ing the he cha hang nge. . Revisio evisions ns can n be compare pared, d, re restored, red, and nd with h some types of file les, s, merg rged. d. • https://en.wikipedia.org/wiki/Version_contro
What Is Git? Which means a version control system is: Vers rsion ion cont ntrol rol is the he mana nagement gement of cha hang nges es to collectio lections ns of inf nformation. rmation. Cha hang nges es are ide dentified ntified by by a nu numbe ber r associated ciated with th a tim imestamp estamp and nd the he pe person son maki king ng the he cha hang nge. e.
What Tools Do I Need?
Recommended Software ht https://c ps://chocolat hocolatey.org ey.org ht https://c ps://chocolat hocolatey.org/in ey.org/install stall
Required Tools Gi Git To t Tools ls ht https://g ps://gitforwindows itforwindows.org/ .org/ > choco install git -y https://git-scm.com/download/mac > apt install git-all
Recommended Tools posh-git GitHub Pull Requests Gi Git Ext t Exten ensions ions PSGit Gi Git Cr t Cred edential ential Man anager ager Fo For r Wi Windows ows
Who uses Git?
Companies & Projects You Know
Git Providers & Software
Microsoft Windows & GVFS 1760 Windows Builds (per Windows Bui lds (per day) day) 4352 Active B Active Branches ranches 2500 Pull R Pull Requests (p equests (per day) er day) 8421 Code Pushes (per Code Pushes (per day) day) As at May 2017 (Using GVFS) https://blogs.msdn.microsoft.com/bharry/2017/05/24/the-largest-git-repo-on-the-planet/
DSCResources Repository Statistics 475 Pull Requests 300 Closed Issues Since 1 January 2018 https://blogs.msdn.microsoft.com/powershell/2018/09/13/desired-state-configuration-dsc-planning-update-september-2018/
Who Uses Git? Developers, Coders CI / CD, & Scripters Runbooks, Cookbooks Websites Writers
Why Do I Need To Use Git?
If you write code … … you are a developer
2017 GitHub Use 1 B 1 Bil illio lion n Commi mmits ts 47 Mil illion lion Pu Pull ll Re Requests ests 25.3 3 Mil illion lion Acti tive ve Re Reposi sito tories ries 24 Mil illion lion Dev evelope elopers rs https://octoverse.github.com/
Git Has Your Back Change History CI / CD Undo Collaborate Mistakes Open Source
Even n Th The Beards rds Use It It
How Does Git Work? The 3 Stages Of Git
8 Essential Git Commands ? clo lone ne sta tatu tus pull ll + add ad commit mmit chec eckou out push re remo mote te
The 3 Stages > git add > git commit <. | FILES> –m ‘Message’ > git status Stage Commit Change changed changes source files files Sta tage ged Committ Co tted Unsta tage ged
The 5 Fundamental Building Blocks Of Git repository pository fork * br branc nches hes pu pull ll requests quests commit mit
What Is A Repository? Repository / Repo – terminology - both used Just a folder where you store your project files myproj
How Do Branches Work? fix-memory-leak branch update-doc branch dev branch master branch
What Is A Commit? > git commit –m ‘Message’ When one or more changes Commit have been applied to a branch, changes its called a … commit mmit Co Committ tted
What Is A Fork? cool-project fork repository link my/cool-project cool-project Forking a repo is simply creating a linked copy of that repository. The link allows changes to be pulled or pushed to the original repository.
What Is A Pull Request? update-doc branch master branch Lets others know about Allows review and a change you have discussion around those made. changes.
Essential Git Commands
DEMO Our First Pull Request
Git Cycle > git pull > git add . > git push > git commit – m “Initial commit” Pu Pull ll Pu Push Commit mit
Pull Request Flow dev branch created dev branch from master merged to master master branch > git add . > git checkout – b dev > git commit –m “ msg ” > git push review changes commit code submit pull request
Summary • We learned what Git is and where it came from; • What tools are needed to work with Git; • Who is using Git and why I need to use it! • Fundamental Git commands; • The three stages of Git; • What a pull request is, why we use them and how to use it to work with Open Source projects;
Congratulations! You’re now a git ! git
Questions?
Speaker Scholarship bit.ly/ds- speaker Inclusion – Diversity – Community DATA:Scotland
Thank You! pauby.com @pauby github.com/pauby linkedin.com/in/paulbroadwith Paul Broadwith pau.by/talks
Recommend
More recommend