Skip to content

Git Workflow

Julia Nguyen edited this page Oct 9, 2022 · 5 revisions

Please connect to GitHub via SSH and not HTTPS, check out the instructions here.

Forking and Pull Requests

  1. Fork the if me repo (if you haven't already done so).
  2. Clone it to your computer.
  3. When you're ready to work on an issue, be sure you're on the main branch. From there, create a separate branch (e.g. issue_32).
  4. Make your changes. If you're unsure of some details while you're making edits, you can discuss them on the ticket or in Slack.
  5. Commit your changes.
  6. Push the working branch (e.g. issue_32) to your remote fork.
  7. Make the pull request (on the upstream main branch)
  • Do not merge it with the main branch on your fork. That would result in multiple, or unrelated patches being included in a single PR.
  1. If any further changes need to be made, comments will be made on the pull request.

It's possible to work on two or more different patches (and therefore multiple branches) at one time, but it's recommended that beginners only work on one patch at a time.

Syncing

Periodically, you'll need to sync your repo with mine (the upstream). GitHub has instructions for doing this.

  1. Configuring a remote for a fork
  1. Syncing a Fork
  • On that page, it shows how to merge the main branch (steps 4 & 5).
  1. When your patch is completed, do not merge your patch into the main branch of your locally cloned fork. Your patch will be merged when you sync with the remote fork.

Checking Out Someone Else's Fork

This is useful if you're doing a code review and you want to demo someone's changes in your dev environment.

  1. Add someone's remote fork: git remote add [username] https://github.com/[username]/ifme.git
  2. Fetch their fork: git fetch [username]
  3. Checkout a specific branch: git checkout --track [username]/[branch name]
Clone this wiki locally