# 3.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. When you ran the `bash setup.sh` script in step [3.1.2 to install OpenCRVS locally](/v1.3/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>".
2. Next, we strongly recommend that you [create or use an existing organisation](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/creating-a-new-organization-from-scratch) account on Github for storing your country configuration fork so that you can share access amongst your internal team safely.
3. [Create a new, **private** Git repository](https://docs.github.com/en/get-started/quickstart/create-a-repo) named the same as your new directory, ie: "opencrvs-\<your country>" on your organisation's account on Github.
4. Copy the **Git URL** to this repository, e.g. **<https://github.com/\\><your organisation>/opencrvs-\<your country>.git**
5. In Terminal, `cd` inside your local directory for the country configuration, opencrvs-\<your country>. If you run `git remote -v` inside this directory you should see that the origin Git URLs are still pointing to our Farajaland repo. We need to point these origin URLs to your repo. To do that, run this command:&#x20;

```
git remote set-url origin https://github.com/<your organisation>/opencrvs-<your country>.git
```

6. You can check that the origin URLs have changed successfully by running `git remote -v` again.
7. Ensure that you are on the master branch of the country configuration folder: `git checkout master`
8. Run `git push` to push the Farajaland code to your repo. Once the files are pushed you should see the country configuration code on your own Github repo.
9. 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 develop features on feature branches, merge them into develop for testing and main or master for releases.   Therefore create a companion **develop** branch that you will use for developing the rest of your configuration:  `git checkout -b develop` & then push that code up to your new repository with `git push`
10. &#x20;It is very important that you configure [branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) on your master, develop and main branches as these branches should not be able to be pushed to by any developer without a pull request for code review.

{% hint style="info" %}
It's up to your team to decide how you wish to manage pulling future release code from our countryconfig / "farajaland" repo.  2 example strategies are explained below.
{% endhint %}

#### Strategy 1:

1. Add in our countryconfig repo as a new origin named "farajaland"

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

2. Maintain a new branch that you use to pull in latest releases. You can use this to review changes in a pull request before fixing conflicts.

```
// when you are ready to upgrade

git checkout -b farajaland-master
git pull farajaland master
git push --set-upstream origin farajaland-master

// review conflicts on github
// fix conflicts and merge into develop for QA & Production
```

#### Strategy 2:

1. Add in our countryconfig repo as a new origin named "farajaland"

```
git remote add farajaland git@github.com:opencrvs/opencrvs-countryconfig.git
```

2. Set up dedicated default branches that you use, such as: **master-\<your country code>, develop-\<your country code>** .

```
git checkout -b master-<your-country-code>
git push --set-upstream origin master-<your-country-code>
git checkout -b develop-<your-country-code>
git push --set-upstream origin develop-<your-country-code>
// set your defaults to these branches with branch protection rules

// When you are ready to upgrade
git checkout master
git pull farajaland master
git push origin master

// open PRs from master into your develop-<your-country-code> branch
// fix conflicts and merge into develop-<your-country-code> for QA
// merge into your master-<your-country-code> branch for Production
```

{% hint style="warning" %}
Following best practices, we recommend that you setup [branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches) so that no developer can push code to your important branches without a pull request
{% endhint %}


---

# 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/v1.3/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.
