Gi Git t Fu Fund ndam amen enta tals ls Open up a world of - - PowerPoint PPT Presentation

gi git t fu fund ndam amen enta tals ls
SMART_READER_LITE
LIVE PREVIEW

Gi Git t Fu Fund ndam amen enta tals ls Open up a world of - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Paul Broadwith @pauby https://blog.pauby.com

Gi Git t Fu Fund ndam amen enta tals ls

Open up a world of community and collaboration

slide-2
SLIDE 2
slide-3
SLIDE 3
  • Paul Broadwith, Glasgow, Scotland
  • 25+ years in defence, government, financial

sectors

  • Lead Engineer on Boxstarter and Chocolatey

cChoco DSC Resource

Who Am I?

slide-4
SLIDE 4

Qu Questio ions A At Th The En End? d?

slide-5
SLIDE 5

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;
slide-6
SLIDE 6

Who Is This Aimed At?

Level 100

slide-7
SLIDE 7
slide-8
SLIDE 8

Git

is not

GitHub

slide-9
SLIDE 9

What at Is Is G Git it?

slide-10
SLIDE 10

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
slide-11
SLIDE 11

What Is Git? Which means Git is: Git t is a version sion cont ntrol

  • l 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.

slide-12
SLIDE 12

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

  • the

her r coll llecti ction

  • ns

s of inf nfor

  • rmat

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

  • n 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
slide-13
SLIDE 13

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.

slide-14
SLIDE 14

What Tools Do I Need?

slide-15
SLIDE 15

Recommended Software ht https://c ps://chocolat hocolatey.org ey.org ht https://c ps://chocolat hocolatey.org/in ey.org/install stall

slide-16
SLIDE 16

Required Tools

Gi Git To t Tools ls

> choco install git -y ht https://g ps://gitforwindows itforwindows.org/ .org/ https://git-scm.com/download/mac > apt install git-all

slide-17
SLIDE 17

Recommended Tools

Gi Git Cr t Cred edential ential Man anager ager Fo For r Wi Windows

  • ws

Gi Git Ext t Exten ensions ions

GitHub Pull Requests

posh-git

PSGit

slide-18
SLIDE 18

Who uses Git?

slide-19
SLIDE 19

Companies & Projects You Know

slide-20
SLIDE 20

Git Providers & Software

slide-21
SLIDE 21

Microsoft Windows & GVFS

8421 2500 4352 1760

Code Code Pushes (per Pushes (per day) day) Pull R Pull Requests (p equests (per day) er day) Active B Active Branches ranches Windows Bui Windows Builds (per lds (per day) day)

https://blogs.msdn.microsoft.com/bharry/2017/05/24/the-largest-git-repo-on-the-planet/

As at May 2017 (Using GVFS)

slide-22
SLIDE 22

DSCResources Repository Statistics

https://blogs.msdn.microsoft.com/powershell/2018/09/13/desired-state-configuration-dsc-planning-update-september-2018/

Since 1 January 2018

475 Pull Requests 300 Closed Issues

slide-23
SLIDE 23

Who Uses Git? Writers Websites Developers, Coders & Scripters CI / CD, Runbooks, Cookbooks

slide-24
SLIDE 24

Why Do I Need To Use Git?

slide-25
SLIDE 25

If you write code … … you are a developer

slide-26
SLIDE 26

2017 GitHub Use

https://octoverse.github.com/

47 Mil illion lion Pu Pull ll Re Requests ests 24 Mil illion lion Dev evelope elopers rs 25.3 3 Mil illion lion Acti tive ve Re Reposi sito tories ries 1 B 1 Bil illio lion n Commi mmits ts

slide-27
SLIDE 27

Git Has Your Back Change History Undo Mistakes Collaborate CI / CD Open Source

slide-28
SLIDE 28
slide-29
SLIDE 29

Even n Th The Beards rds Use It It

slide-30
SLIDE 30

How Does Git Work?

The 3 Stages Of Git

slide-31
SLIDE 31

8 Essential Git Commands

sta tatu tus

?

ad add

+

pull ll clo lone ne push chec eckou

  • ut

commit mmit re remo mote te

slide-32
SLIDE 32

The 3 Stages

Unsta tage ged Sta tage ged Co Committ tted

> git status > git add <. | FILES> > git commit –m ‘Message’

Change source files Stage changed files Commit changes

slide-33
SLIDE 33

The 5 Fundamental Building Blocks Of Git commit mit pu pull ll requests quests repository pository fork * br branc nches hes

slide-34
SLIDE 34

What Is A Repository? Just a folder where you store your project files Repository / Repo – terminology - both used

myproj

slide-35
SLIDE 35

How Do Branches Work?

master branch update-doc branch dev branch fix-memory-leak branch

slide-36
SLIDE 36

What Is A Commit?

When one or more changes have been applied to a branch, its called a … commit mmit

Co Committ tted

> git commit –m ‘Message’

Commit changes

slide-37
SLIDE 37

What Is A Fork? cool-project my/cool-project cool-project fork repository link 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.

slide-38
SLIDE 38

What Is A Pull Request? Allows review and discussion around those changes.

master branch update-doc branch

Lets others know about a change you have made.

slide-39
SLIDE 39

Essential Git Commands

slide-40
SLIDE 40

DEMO

Our First Pull Request

slide-41
SLIDE 41

Git Cycle

Pu Push Commit mit Pu Pull ll

> git pull > git add . > git commit –m “Initial commit” > git push

slide-42
SLIDE 42

Pull Request Flow master branch dev branch created from master commit code submit pull request dev branch merged to master review changes > git checkout –b dev > git add . > git commit –m “msg” > git push

slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45

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;

slide-46
SLIDE 46

Congratulations! You’re now a git !

git

slide-47
SLIDE 47

Questions?

slide-48
SLIDE 48

DATA:Scotland

Speaker Scholarship

Inclusion – Diversity – Community

bit.ly/ds- speaker

slide-49
SLIDE 49
slide-50
SLIDE 50

Thank You! linkedin.com/in/paulbroadwith

pau.by/talks

Paul Broadwith

pauby.com @pauby github.com/pauby