Collaborative Git

In this session you will use Git to collaborate on a project with a classmate. While you're doing this you will re-create a challenging situation - the dreaded merge conflict.

Housekeeping


Daily Standup

In the same groups as last class

Each person takes a turn to answer the following questions:

  1. What did you do yesterday?
  2. What will you do today?
  3. Anything blocking your progress?

Activity: Commit Catch and Markdown Review

Materials

Instructions

In pairs, or groups of three:

  1. Set up a shared repo with your partner(s) according to the instructions in Commit Catch.
  2. Think of a job, game, sport, task, something that you share with your partner.
  3. Pick a partner to create a new README.md document;
  4. Add a level one heading with a title of your document:
    • An h1 heading # Name of activity
  5. Add, commit and push your changes and switch roles;
  6. Have the other partner pull the changes just added and repeat Steps 4 and 5 by adding at one of the following:
    • A very short description of the activity (just write)
    • An h2 heading ## Task List
    • A list of steps involved in your task or your task’s responsibilities (ordered with numbers or unordered with dashes)
    • Include a link to a website that relates to your activity in some way [text that is seen](https://pathtosite.org)
  7. Continue until your document contains satisfies the requirements for Today’s Achievement.

Merge Conflicts

Git Conflicts

Activity: Creating a Merge Conflict

Using the same partner(s) and repo from the earlier activity, create a merge conflict.

Instructions

With a clean working tree and up-to-date local repos:

  1. Have both/all partners make a change to the same line of code;
  2. Have one partner add, commit and push their changes;
  3. Have the second partner try to add, commit and push their changes;
  4. Resolve the resulting merge conflict by following the instructions in this activity.

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.

Today's Achievement

Commit Catch

Submit the repo that you created with your partner(s) to Brightspace.

As a comment in your submission, include:

  • A link to your GitHub repo (which should include your partner(s) as collaborators).
  • The classmate(s) you created the document with.

Marking Criteria

  1. Your document should include at least one of the following in valid markdown syntax:
    • Level 1 heading
    • Level 2 heading
    • Paragraph
    • Bold text
    • Italicized text
    • A numbered list OR a bulleted list
    • A link to an external website
  2. There should be at least two commits from EACH team member in your Git history.