High level overview: pull latest master, make a branch, commit changes, push to GitHub, make a PR, get it approved, merge it to master. Rinse and repeat.
- Make issue corresponding to feature
git checkout mastergit pullto get master up to dategit checkout -b YOUR-NEW-BRANCH-NAMEto switch to a new branch- Make commits for a given feature.
- Use semantic commit messages:
type(scope): messagee.g.feat(client): switch to React-Redux - Keep commits related to that feature branch. If you need to make other commits, go back to master, make a new branch, add those separate commits etc.
- When you are done,
git push -u origin YOUR-NEW-BRANCH-NAME - Navigate to GitHub
- Select "open pull request"
- Refer to any issues the PR will close, e.g.
Closes #32, closes #46. You need to use "closes" for each issue separately. - Request a review
- Address review comments by pushing more commits
- When all checks pass, merge to
master - On your local machine,
git checkout master git pull- Start the cycle again
GitHub has an online merge conflict resolution tool, but you can and should learn how to fix merge conflicts locally too.
- On your local machine,
git checkout master git pullgit checkout YOUR-FEATURE-BRANCHgit merge mastergit status- Find all conflicts and fix them manually. Collaborate / communicate with teammates to decide how best to do so!
git add -Agit commitgit push- Check that the PR now has no conflicts.