From 9d1262c7da492315a5c7f4ab6a3d82a0d110f7ee Mon Sep 17 00:00:00 2001 From: 20vaidehiv-lgtm <20vaidehiv@gmail.com> Date: Sun, 6 Dec 2026 07:55:22 +0530 Subject: [PATCH] Docs: add FAQ to contributing guide --- CONTRIBUTING.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11a902c..9c73f8d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,6 +55,7 @@ pytest ``` ## 5. Commit and push + Use a clear message: ```bash git commit -m "Fix: ignore extra spaces in count_words (closes #3)" @@ -62,8 +63,98 @@ git push origin fix-short-description ``` ## 6. Open a Pull Request + Fill in the PR template and write `Closes #`. A maintainer will review it, usually within a few days. +## Frequently Asked Questions + +### How do I keep my fork up to date? + +First, make sure your working tree is clean. Commit or stash any uncommitted changes before switching branches. + +If you haven't already added the original repository as a remote, add it once: + +```bash +git remote add upstream https://github.com/codepiyusss/open_source_issue_contribution.git +``` + +Fetch the latest changes from the original repository and merge them into your local `main` branch: + +```bash +git fetch upstream +git switch main +git merge upstream/main +git push origin main +``` + +This updates your fork's `main` branch with the latest changes from the original repository. + +### How do I resolve a merge conflict? + +Merge conflicts happen when Git cannot automatically combine changes. + +1. Run `git status` to identify the conflicted files. +2. Open each conflicted file and look for conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`). +3. Edit the files to keep the correct changes and remove the conflict markers. +4. Stage the resolved files: + +```bash +git add +``` + +5. Complete the merge: + +```bash +git merge --continue +``` + +If you want to cancel the merge instead, run `git merge --abort`. + +### What should I do if CI fails? + +1. Open your pull request on GitHub. +2. Check the failed status checks and open the corresponding logs. +3. Identify the cause of the failure. +4. Reproduce the issue locally where possible and fix it. +5. Run the relevant tests before pushing your changes. + +After fixing the issue, stage, commit, and push your changes: + +```bash +pytest +git add +git commit -m "Fix failing CI checks" +git push origin +``` + +If the failure is unrelated to your changes, check the logs and ask a maintainer for guidance. + +### How do I add more changes to an already-open pull request? + +You do not need to open another pull request. + +1. Switch to the branch associated with your existing pull request: + +```bash +git switch +``` + +2. Make your additional changes. +3. Stage and commit them: + +```bash +git add +git commit -m "Update contribution" +``` + +4. Push to the same branch: + +```bash +git push origin +``` + +GitHub will automatically update your existing pull request with the new commits. + ## Style - Python 3.8+, follow PEP 8. - Add docstrings to new functions.