From 2a7c4ab30be437fd25bd3994e5bd5fb66b8e4a9a Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Thu, 24 Oct 2024 09:12:40 +0530 Subject: [PATCH] Add FAQ on how to resolve merge conflicts (#70) --- docs/contributing.md | 51 ++++++++++++++++++++++++++++++++++++++++++-- docusaurus.config.ts | 11 +++++----- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/docs/contributing.md b/docs/contributing.md index e230420..d11bbd5 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -44,7 +44,7 @@ To get familiar with our tech stack, you can follow these courses: ## How to Contribute 1. **Find an Issue**: - Browse issues on [care](https://github.com/coronasafe/care/issues) and [care_fe](https://github.com/coronasafe/care_fe/issues). - - Look for issues labeled `good-first-issue`. + - Look for issues labeled `good first issue`. 2. **Claim the Issue**: - Comment on the issue explaining your approach and request to assign it to you. @@ -71,10 +71,57 @@ To get familiar with our tech stack, you can follow these courses: ## Support If you need help, you can: -- Check the project's documentation. +- Check the project's documentation and [FAQ](#frequently-asked-questions). - Ask questions in the relevant Slack channels. - Look for help in the community forums. +## Frequently Asked Questions + +### How to resolve merge conflicts? + +Often, when you are working on a feature branch and the base branch gets updated in the original repository, conflicts may arise if both you and the base branch modified the same file or lines. + +Follow these steps to resolve merge conflicts when syncing your feature branch with the latest changes from the develop branch in the org’s repository: + +1. Ensure you have the latest develop branch from the org’s repository: + +```bash +# First, verify that you have the org’s repository added as a remote. You can check by running: +git remote -v + +# If it’s not added, you can add it using the following command: +git remote add upstream https://github.com/ohcnetwork/care_fe.git +git fetch upstream + +# Merge the latest `develop` branch into your working branch +git merge upstream/develop +``` + +2. Resolve conflicts if any + +- If there are merge conflicts, git will pause and show the files with conflicts. +- Open those files in your editor and look for lines like: + +```text + <<<<<<< HEAD + // Your changes + ======= + // Changes from upstream + >>>>>>> upstream/develop +``` + +- Resolve the conflicts by choosing which changes to keep or combining them as needed. You can use VS Code Editor to resolve these conflicts. [See how](https://code.visualstudio.com/docs/sourcecontrol/overview#_merge-conflicts). + +3. After resolving the conflicts, mark them as resolved and commit the merge: + +```bash +git add . +git commit +``` + +That's it! Now you can push your changes. + + ## Code of Conduct We expect all contributors to adhere to our [Code of Conduct](https://github.com/coronasafe/care/blob/develop/CODE_OF_CONDUCT.md). diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 85969c1..48910ad 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -50,7 +50,7 @@ const config: Config = { language: ["en"], }, ], - '@docusaurus/theme-mermaid' + "@docusaurus/theme-mermaid", ] satisfies PluginConfig[], markdown: { @@ -73,10 +73,10 @@ const config: Config = { { to: "/blog", label: "Blog", position: "left" }, { to: "/docs/contributing", label: "Contribute", position: "left" }, { - href: 'https://github.com/ohcnetwork/docs', - position: 'right', - className: 'header-github-link', - 'aria-label': 'GitHub repository', + href: "https://github.com/ohcnetwork/docs", + position: "right", + className: "header-github-link", + "aria-label": "GitHub repository", }, ], }, @@ -95,6 +95,7 @@ const config: Config = { prism: { theme: prismThemes.github, darkTheme: prismThemes.dracula, + additionalLanguages: ["bash"], }, } satisfies Preset.ThemeConfig, };