Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

image-20241104-111319.png

Here are the steps to track and fix an issue, create a branch, make changes, and open a PR to address comments:

1. Create an Issue

  • Create an issue on Github

  • Copy the issue number (e.g., #42) to reference in your branch name.

2. Create a Branch for the Issue

  • In your local Git repository, create a new branch from the main branch with a name that includes the issue number, e.g., issue-42-fix-feature.

    Code Block
    git checkout main 
    git pull origin main # Ensure your main branch is up-to-date 
    git checkout -b issue-42-fix-feature

3. Make the Necessary Changes

  • Edit the files necessary to resolve the issue.

  • After making changes, add them to the staging area:

    Code Block
    git add .

  • Commit the changes with a message referencing the issue:

    Code Block
    git commit -m "Fixes #42: Describe the specific fix here"

Have all commit message start with the issue number they contribute to,
e.g. “#12. Example music code, test missing”.
You’ll see that GitHub than automatically matches commits to issues

4. Push the Branch to the Remote Repository

  • Push your branch to the remote repository to make it accessible for review:

    Code Block
    git push origin issue-42-fix-feature

5. Create a Pull Request (PR)

  • Create a Pull Request from your newly pushed branch.

  • Open a PR with the following:

    • Title: Briefly describe the fix.

    • Description: Explain the changes, referencing the issue

  • Click Create Pull Request.

6. Address PR Comments

  • Reviewers may leave comments on your PR.

  • Make any required modifications locally in the same branch (issue-42-fix-feature).

  • After making the changes, commit them:

    Code Block
    git add . 
    git commit -m "Address PR comments"

  • Push the updated branch:

    Code Block
    git push origin issue-42-fix-feature

  • Continue this process until all comments are resolved, and the reviewers approve your PR.

7. Merge the PR and Close the Issue

  • Once the PR is approved, merge it into the main develop branch

  • The linked issue will automatically close if you used keywords like "Closes #42" in your PR description.

  • Delete the branch if no longer needed.