GIT FOR TEAMS!

OBJECTIVES

  • Discuss best practices for setting up a team
  • Use the feature branch workflow with teams
  • Walk through dealing with merge conflicts

REVIEW

WHAT IS GIT?

WHAT IS GITHUB?

WHY DO WE USE VERSION CONTROL?

SETTING UP A TEAM

ROLES

GITHUB FEATURES

BUS FACTOR

SETTING UP A TEAM

ROLES

PROJECT MANAGER /

SCRUM MASTER

REPO OWNER /

SINGLE SOURCE OF TRUTH

SETTING UP A TEAM

ROLES

EVERYONE CODES!

SETTING UP A TEAM

GITHUB FEATURES

SETTING UP A TEAM

BUS FACTOR

How many people could get hit by a bus and the project would be able to live on?

Hint: A bus factor of 1 is bad.

FEATURE BRANCH WITH TEAMS

STEP 1

REPO OWNER

EVERYONE ELSE

create local repo

get initial commit in

fork after initial commit

DO NOT FORGET .gitignore

FEATURE BRANCH WITH TEAMS

STEP 2

REPO OWNER

EVERYONE ELSE

Clone down

Add upstream remote that points to repo owners GH repo

Add at least 1 other person as contributor to repo

FEATURE BRANCH WITH TEAMS

STEP 3

REPO OWNER

EVERYONE ELSE

CHECKOUT BRANCH AND DO WERK

CHECKOUT BRANCH AND DO WERK

FEATURE BRANCH WITH TEAMS

STEP 4

REPO OWNER

EVERYONE ELSE

Push local branch to repo

Push local branch to origin

FEATURE BRANCH WITH TEAMS

STEP 5

REPO OWNER

EVERYONE ELSE

Submit PR to master

Submit PR to upstream repo

FEATURE BRANCH WITH TEAMS

STEP 6

REPO OWNER

EVERYONE ELSE

Merge PRs

FETCH / MERGE || PULL to local master & branch you're presently working on.

FETCH / MERGE || PULL to local master & branch you're presently working on.

Don't forget to occasionally push to GH origin master

FEATURE BRANCH WITH TEAMS

STEP 7

REPO OWNER

EVERYONE ELSE

REPEAT STEPS 3-6

REPEAT STEPS 3-6

FEATURE BRANCH WITH TEAMS

Let's go do this!

You have 20 minutes. 

Each person creates a repo with a Readme.md

Each person fork & clones other person's repo. 

Submit a PR on the repo.

Merge the PR.

Get local repo up to date

MERGE CONFLICTS

MERGE CONFLICTS

#realtalk

Merge conflicts happen.

Merge conflicts are avoidable most of the time.

They aren't THAT miserable to handle.

Don't be upset with whoever caused it.

Don't abandon the repo owner to deal with it alone.

MERGE CONFLICTS

I need three volunteers!

MERGE CONFLICTS

Tips for Avoiding Conflicts

  • Don't work in the same files
  • Trust your teammates
  • Pair program through tough challenges
  • Duplicate files then put them together later

git for teams

By Valerie Kraucunas

git for teams

  • 724