Skip to main content

Day 4 - Collaborative Git I

Assignment 3 - Merge Conflicts

  • Due Friday: October 7th @ 11:59pm
  • Goal: Resolve Merge Conflicts

Collaborating with Git

  • How multiple people can work on code together
  • Makes use of branches and forks
  • branch diagram
  • Can be a dream to work with when your team works together, but a a nightmare if your team doesn’t communicate
    • Establish team rules and follow them
    • Git is very flexible and allows for lots of different work flows, determine what works best for your team, write it down, follow it

Warmup Activity Collaborative Code Plan Activity

  • Use your team for CPNT-260
  • In a debrief, each team will discuss synchronous and asynchronous tasks in your workflows

Feature Branches

  • It can be risky for everyone on a team to merge into the main branch
  • Especially on large projects, using feature branches and a development branch can be useful for moving a project forward in stages
  • Git Feature Branch Workfow
  • Plan out how you’ll approach moving code into the main branch and open pull requests

Activity: Add feature branches to your 1st activity

  • Determine what should be in the initial main branch at setup
  • Plan out what should be feature branches
  • Decide if you want a development or testing branch
  • Agree on a workflow
  • Debrief: Dicuss your workflow

Merge Conflicts

Terminology

Merge : When two branches in Git are merged into one. This will often happen if two developers are submitted code to a project or one developer is submitting code from two machines.

Merge conflict : When two branches edit the same line of code. Git doesn’t know which change to keep so it leaves it to the developer to decide when remote code is pulled.

Current Change : The change (relevant to the conflict) that was made on the local repo.

Incoming Change : The change that is incoming from the remote repo.

Resolving Conflicts


Lab Time

  • Work on assignment 3
  • Work on 260 assignments

Resources