Slide 1

Slide 1 text

Git and GitHub Workflows Information to aid your VCS and branching decisions ! a discussion with Matthew McCullough

Slide 2

Slide 2 text

[email protected] @matthewmccull matthewmccullough !

Slide 3

Slide 3 text

software development

Slide 4

Slide 4 text

decisions… decisions… decisions… decisions…

Slide 5

Slide 5 text

decisions… decisions… decisions… decisions… Platform Language IDE Process

Slide 6

Slide 6 text

but the initial decisions are…

Slide 7

Slide 7 text

VCS decisions ➊

Slide 8

Slide 8 text

basis for other decisions ➊

Slide 9

Slide 9 text

de-centralized centralized

Slide 10

Slide 10 text

Git and GitHub Workflows GitHub Flow Git Flow Rebase It Squash It Linear Fast iterations Git Project Workflow Flow Types Aims Long-lived release branches Maintenance Commands rebase master merge --squash rebase -i commit —amend pull -r bisect Easy regression discovery Developer on boarding Continuous Integration Build all branches Version Control UI Handles rebased branches? Triggers UI updates on merges? Pull Requests Commit keywords: “fixes #22” revert Setting up jobs Push branch to production Chatops Deploying to branches Reverse merges merge master topic Deployments API GitHub Releases API Semantic versioning best practices Teams Solo 1-5 5-15 15-50 50-150 150+ reset --hard reset --soft rebase --autosquash -i GitHub Deployments API Centralized Decentralized ➊

Slide 11

Slide 11 text

➊ " " " " " " " "

Slide 12

Slide 12 text

Slide 13

Slide 13 text

➊ #

Slide 14

Slide 14 text

➊ $

Slide 15

Slide 15 text

Team decisions ➋

Slide 16

Slide 16 text

how many team members? ➋

Slide 17

Slide 17 text

1 team member? ➋

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

1 to 5 team members? ➋

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

5 to 15 team members? ➋

Slide 22

Slide 22 text

15 to 50 team members? ➋

Slide 23

Slide 23 text

50 to 150 team members? ➋

Slide 24

Slide 24 text

150+ team members? ➋

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

optimization decisions ➌

Slide 30

Slide 30 text

optimized for fast iterations? ➌ GitHub Flow

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

master

Slide 33

Slide 33 text

master topic

Slide 34

Slide 34 text

master topic

Slide 35

Slide 35 text

master topic

Slide 36

Slide 36 text

master topic

Slide 37

Slide 37 text

master topic

Slide 38

Slide 38 text

# ➌

Slide 39

Slide 39 text

optimized for release maintenance? ➌ Git Flow

Slide 40

Slide 40 text

Time release branches master develop hotfixes feature branches Feature for future release Major feature for next release Severe bug fixed for production: hotfix 0.2 Tag 0.1 Tag 0.2 Incorporate bugfix in develop

Slide 41

Slide 41 text

Tag 1.0 From this point on, “next release” means the release after 1.0 Bugfixes from rel. branch may be continuously merged back into develop Only bugfixes! 1.0

Slide 42

Slide 42 text

command line tooling ➌

Slide 43

Slide 43 text

➌ #

Slide 44

Slide 44 text

optimized for developer on-boarding ➌ atomic flow

Slide 45

Slide 45 text

master

Slide 46

Slide 46 text

master topic

Slide 47

Slide 47 text

master topic

Slide 48

Slide 48 text

master topic

Slide 49

Slide 49 text

master topic

Slide 50

Slide 50 text

master topic

Slide 51

Slide 51 text

➌ #

Slide 52

Slide 52 text

optimized for clarity & maintenance ➌ git.git gitworkflows

Slide 53

Slide 53 text

Slide 54

Slide 54 text

maint master next pu ➌

Slide 55

Slide 55 text

➌ #

Slide 56

Slide 56 text

command decisions ➍

Slide 57

Slide 57 text

$ git merge master ➍

Slide 58

Slide 58 text

$ git revert ➍

Slide 59

Slide 59 text

$ git commit --amend ➍

Slide 60

Slide 60 text

$ git pull -r ➍

Slide 61

Slide 61 text

$ git rebase master $ git rebase -i $ git rebase --autosquash -i ➍

Slide 62

Slide 62 text

$ git merge —squash ➍

Slide 63

Slide 63 text

$ git bisect start $ git bisect good $ git bisect bad $ git bisect run $ git bisect log ➍

Slide 64

Slide 64 text

$ git reset --hard $ git reset --soft $ git reset --mixed ➍

Slide 65

Slide 65 text

So what workflow should I chose Matthew?

Slide 66

Slide 66 text

mix and match

Slide 67

Slide 67 text

the simplest thing that works

Slide 68

Slide 68 text

[email protected] @matthewmccull matthewmccullough !

Slide 69

Slide 69 text

[email protected] training.github.com @githubtraining githubtraining !