# 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](https://documentation.opencrvs.org/setup/3.-installation/3.1-set-up-a-development-environment/3.1.2-install-opencrvs-locally), 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="https://3485090019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRziAMaeBMeyiTg5hfFq5%2Fuploads%2Fgit-blob-c2ea472eeeb1cf3e8ff72d4a4d67ee02801495b4%2FScreenshot%202024-11-11%20at%2015.56.57.png?alt=media" 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.
