# 4.2.1 Fork your own country configuration repository

{% embed url="<https://www.youtube.com/watch?ab_channel=OpenCRVS&v=uWzUXzRLAe0>" %}

The first step towards configuring your own country configuration of OpenCRVS is to [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) our existing country configuration based on our demonstration country [Farajaland - Repo: opencrvs-countryconfig](https://github.com/opencrvs/opencrvs-countryconfig). the following steps help you change the cloned Farajaland repo into your own country configuration fork.

### 📘 1. Pre-Fork Preparation

Before you fork, ensure the following:

#### ✅ Use a GitHub Organisation

* Forking must be done **within a GitHub Organisation**, not a personal account.
* The Organisation must be on a **GitHub Team or Enterprise plan** (required for branch protection rules).
* You must have **Admin rights** in that Organisation.

#### 🧱 Choose a Clear Repository Name

When you ran the `bash setup.sh` script in step [3.1.2 to install OpenCRVS locally](/setup/3.-installation/3.1-set-up-a-development-environment/3.1.2-install-opencrvs-locally.md), the country configuration repo for Farajaland was cloned into the same parent directory as opencrvs-core, as you are probably aware. The first thing that you want to do is to change the name of the cloned opencrvs-countryconfig directory to something like "opencrvs-\<your country>".

Use this naming convention:

`opencrvs-<your country name>`

#### 🌿 Plan Your Branching Strategy

We strongly recommend that you set up a [Gitflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) branching strategy on your repo to ensure that you can configure on feature branches, merge them into develop for testing and main or master for releases.

| Branch      | Purpose                        |
| ----------- | ------------------------------ |
| `main`      | Production-ready configuration |
| `develop`   | QA or staging configuration    |
| `feature/*` | Temporary configuration work   |
| `hotfix/*`  | Urgent production fixes        |

#### 👥 Define Governance

* Add country team members, reviewers, and DevOps maintainers.

***

### 🧑‍💻 2. Forking the Template Repository

1. Go to the OpenCRVS CountryConfig template:\
   👉 <https://github.com/opencrvs/opencrvs-countryconfig>
2. Click **“Fork”** in the top-right corner.
3. Select your **GitHub Organisation** as the destination.
   * Name it using the convention above.
4. Clone your new fork locally:

   ```bash
   git clone git@github.com:<your-org>/opencrvs-countryconfig-<countryname>.git
   cd opencrvs-<countryname>
   ```

Add the official OpenCRVS template as an upstream remote. This will help you keep your configuration up to date when new releases are launched:

```bash
git remote add upstream https://github.com/opencrvs/opencrvs-countryconfig.git
```

🔒 3. Configure Branch Protection Rules To maintain code integrity and review processes:

<figure><img src="/files/XIAF48OmAVNPdus7ECcj" alt=""><figcaption></figcaption></figure>

Go to your new repository on GitHub.

Navigate to: Settings → Branches → Add Branch Protection Rule

Add a rule for the main branch (and optionally develop):

✅ Require pull request reviews before merging

✅ Require status checks to pass before merging (if CI is configured)

✅ Require signed commits (recommended)

✅ Restrict who can push to matching branches (e.g., Admins only)

Save the rule and test it with a dummy PR.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.opencrvs.org/setup/3.-installation/3.2-set-up-your-own-country-configuration/3.2.1-fork-your-own-country-configuration-repository.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
