TUTORIAL: How to Git as a Group - radiatoryang/fall2018_gamedev1_morning GitHub Wiki
- everyone: make sure you are not on the "master" branch, don't work directly on master!
in Sublime Merge menu bar: Repository > Create Branch > type"[your name]-develop"
> [enter] - if you have the master repo: add collaborators to the master repo
in GitHub.com, go to your repo's settings and add each group member as a Collaborator (you will need every group member's GitHub username) - if you have forked the repo: add the master remote as the "upstream"
in Sublime Merge menu bar: Tools > Command Palette (CTRL+P)... and then type:
Add Remote
> [enter] >"upstream"
> [enter] >[paste URL of master repo]
> [enter]
After setup, there are two patterns you have to practice and remember:
- HOW TO GET THEIR WORK
- HOW TO SHARE YOUR WORK
summary: merge upstream/master into your local "develop" branch
- FETCH: updates your map view inside Sublime Merge
- open the sidebar (click the button in top-left)
- right-click on "upstream" (or "origin") and Fetch
- if nothing happened, that means you already see the latest updates
- MERGE:
- make sure you are on your develop branch
- right-click on it and select "merge upstream/master into develop"
- RESOLVE ANY MERGE CONFLICTS:
- on a conflicted file, click "Resolve" button
- in resolve mode, click the arrows next to the line numbers, and choose which version of the chunk to use
- when you have resolved all conflicts, click "Save" button in upper-right
- COMMIT THE MERGE
summary: first get everyone's work and resolve merge conflicts... then, push to GitHub and submit a pull request from your fork
- TEST YOUR CODE, DO NOT SHARE BROKEN STUFF
- FETCH: (see "How To Get Their Work")
- MERGE: (see above)
- RESOLVE MERGE CONFLICTS
- COMMIT THE MERGE
- PUSH YOUR DEVELOP BRANCH
- MAKE A PULL REQUEST
- look at your GitHub fork in browser, verify the push worked
- click "Pull Requests" and create a Pull Request
- in the PR, the "base" should be your group main repo's master branch... and the "compare" should be your develop
- click "Create Pull Request"
- YOUR GROUP SHOULD LOOK AT THE PR
- if you had a job, your boss would review your code or assets
- but in your group, your fellow students should review the code
- if you look at their code / files, and everything seems OK, then write a comment "looks good to me" - if you need a closer look, you can "Checkout" their develop branch and double-check everything
- if you are the last reviewer and everyone says it's good, you can click "Merge Pull Request"
- NEVER MERGE YOUR OWN PULL REQUEST!!! THAT DEFEATS THE PURPOSE OF ALL THIS, AND OUTSIDE OF SCHOOL THIS WILL GET YOU IN TROUBLE