Git - for Teams.

Merge Conflicts

Demo

Ways to deal:

  • Try to avoid merge conflicts by communicating a lot (colocation)
  • Try to avoid working on the same file at the same time
  • If you have a merge conflict, find the person who wrote that code and pair with them on the solution (git blame)
  • Make sure your stories have subtasks small enough that you can generally know which file each and which block of code each person in your team is working on

Activity - 20 minutes

  • TABLE 1: One person owns the repo and does not add other team members as collaborators. Team members fork the project and submit PRS.
     
  • TABLE 2: Everyone is a collaborator and pushes directly to the repo
     
  • TABLE 3: Everyone is a collaborator, with merge privileges, but each team member still forks and submits PRs. Anyone can merge PRs, but the rule is that you can't merge your own.

 

Create an HTML/CSS project. Each member adds a section about themselves to the HTML.

Pros/Cons

  • TABLE 1: One person owns the repo and does not add other team members as collaborators. Team members fork the project and submit PRS.
    - PROS: quality control, CONS: what if owner goes away
     
  • TABLE 2: Everyone is a collaborator and pushes directly to the repo
    - PROS: no obstacles, delays, CONS: merge conflicts
     
  • TABLE 3: Everyone is a collaborator, with merge privileges, but each team member still forks and submits PRs. Anyone can merge PRs, but the rule is that you can't merge your own.
  • PROS: shared responsibility and quality control,
    CONS: ??

Activity: Merge PR

In groups of 2:

  • Each person create a repo with a markdown file
  • Fork and clone partner's repo
  • Make a change - add, commit, push and PR
  • Merge your partner's PR

Merge PR reflect

Advice

  • Never work on master branch

  • Create a develop branch, merge features back into master

  • Write detailed commit messages

  • Don't add all files every time - break up individual commits into smaller pieces

g64 - Git for Teams.

By Michelle Bergquist

g64 - Git for Teams.

  • 92
Loading comments...

More from Michelle Bergquist