# Tips: Switching from a Global configuration to a Committed configuration

{% hint style="info" %}
It is recommended to read first the [Configuration files](https://docs.ci.trust-in-soft.com/configuration-file) section which explain the differences between a **Global configuration** and a **Committed configuration**.
{% endhint %}

{% hint style="success" %}
All examples in this section can be replayed with our [demo-caesar](https://github.com/TrustInSoft-CI/demo-caesar) repository, used for our [Introduction tutorial](https://docs.ci.trust-in-soft.com/tutorial). Feel free to fork this repository to try it by yourself.
{% endhint %}

## Build preparation script

The only difference between the two kind of configurations for the Build preparation script is the current working directory (the root of the repository for a **Global configuration** and the `.trustinsoft`directory for a **Committed configuration)**.

Hence adding a `cd ..` at the beginning of the script is enough to switch to a **Committed configuration**.

{% tabs %}
{% tab title="Global configuration" %}

```bash
#!/bin/bash

set -e

autoconf && ./configure -f
bear make
```

{% endtab %}

{% tab title="Committed configuration" %}

```bash
#!/bin/bash

set -e

cd ..

autoconf && ./configure -f
bear make
```

{% endtab %}
{% endtabs %}

## Analyses configuration file

The only difference between the two kind of configurations for the Analyses configuration is the paths of files which are relative to the root of the repository for a **Global configuration** and to the `.trustinsoft`directory for a **Committed configuration**.

Hence using the [option `"prefix_path"`](https://docs.ci.trust-in-soft.com/analyses-configuration-file#paths-in-analyses-configuration)for each analysis configuration object allows to switch from a **Global configuration** to a **Committed configuration**.

{% tabs %}
{% tab title="Global configuration" %}

```javascript
[
  {
    "name": "Test shift values 7 and -3",
    "files": [ "main.c", "caesar.c" ],
    "cpp-extra-args": "-I ."
  },
  {
    "name": "Test from program inputs",
    "files": [ "main.c", "caesar.c" ],
    "cpp-extra-args": "-I .",
    "main": "main_with_input",
    "val-program-name": "a.out",
    "val-args": "|People of Earth, your attention please|7"
  }
]
```

{% endtab %}

{% tab title="Committed configuration" %}

```javascript
[
  {
    "prefix_path": "..",
    "name": "Test shift values 7 and -3",
    "files": [ "main.c", "caesar.c" ],
    "cpp-extra-args": "-I ."
  },
  {
    "prefix_path": "..",
    "name": "Test from program inputs",
    "files": [ "main.c", "caesar.c" ],
    "cpp-extra-args": "-I .",
    "main": "main_with_input",
    "val-program-name": "a.out",
    "val-args": "|People of Earth, your attention please|7"
  }
]
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
See also [Tips: Factorize options between several analyses](https://docs.ci.trust-in-soft.com/configuration-file/tips-factorize-options-between-several-analyses) to learn how to efficiently add the `"prefix_path"`option to all your analysis configuration objects.
{% endhint %}
