Locking files in repository - Real-Skill/support GitHub Wiki

What it is?

Unfortunately git by default does not provide any measures to lock files on remote repository. That is why we decided to create one by ourselves. Every repository in Realskill containing realskill.json file will be checked if there are any protected files changed in a recent push, and if there were - push is going to be rejected. That allows you to protect your crucial files and tests from being overwriten by third party users.

How to use it

As we mentioned above, the whole magic happens with single realskill.json file. It is a simple JSON structured file with pattern as follows:

{
    "protect": ["<file name>",
                "<directory name>",
                "[...]"]
}

You can add as many elements as you want. This simple example below is going to protect all files in test directory as well as package.json file in main directory.

{
    "protect": ["package.json",
                "test/"]
}
⚠️ **GitHub.com Fallback** ⚠️