Create And Resolve Merge Conflicts - With Basic Workflow

LAB - merge conflicts

  1. Each teammate: Change the same line in same file (e.g. Change "The Solar System" in index.html to some other text).
  2. Commit.
  3. One teammate do a git push; the others git pull.
  4. Among your team, resolve merge conflicts and git push until you all have the same commit sha for HEAD.

Create And Resolve Merge Conflicts - Using Branches and PR's

Github supports two collaborative development models:

  • fork and pull
  • shared repository <--- This is us

"In the shared repository model, collaborators are granted push access to a single shared repository and topic branches are created when changes need to be made. Pull requests (PR's) are useful in this model as they initiate code review and general discussion about a set of changes before the changes are merged into the main development branch. This model is more prevalent with small teams and organizations collaborating on private projects."

We'll be working with the shared repository model.

🤔 Why is it called a "Pull Request", if you're pushing changes?

LAB - Create/Handle merge conflicts again - but now using Pull Requests in your workflow

  1. Each teammate: git checkout -b yourOwnBranchName
  2. Each teammate: Change the same line in same file, like before.
  3. Commit.
  4. git push yourOwnBranchName
  5. Go to Github and make a PR for your branch; choose one or more reviewers.
  6. Reviewers: review/approve the PRs and merge.
  7. Review and merge, git pull, etc. until you all have the same commit sha for HEAD.