Repository selection rules

GitProtect allows configuring selection rules to automatically include or exclude specific Git repositories and projects from backup jobs.

GitProtect provides selection rules, allowing administrators to determine which repositories and projects are included or excluded from backup and recovery tasks. Rules can be based on names, owners, creation dates, branches, or specific patterns, offering granular control over the backup scope and ensuring that only relevant repositories and projects are processed.


Selection rules and rule patterns

Below are the selection rules and rule patterns you can use in GitProtect to select repositories and projects for inclusion in backup jobs within your DevOps organization.

Azure DevOps & Bitbucket

  1. Repository name β€” you can use the full or partial name of a repository. Wildcard characters can be used at the end of the rule to match repository names:

    1. * matches zero or more characters

    2. ? matches exactly one character

  2. Project name: protects all repositories within the specified project.

GitHub

  1. Repository name β€” you can use the full or partial name of a repository. Wildcard characters can be used at the end of the rule to match repository names:

    1. * matches zero or more characters

    2. ? matches exactly one character

  2. Topic name β€” specify the exact name of a topic. For example, if you enter the topic html, all repositories assigned to the html topic will be backed up.

GitLab

  1. Repository name β€” you can use the full or partial name of a repository. Wildcard characters can be used at the end of the rule to match repository names:

    1. * matches zero or more characters

    2. ? matches exactly one character

  2. Topic name β€” specify the exact name of a topic. For example, if you enter the topic html, all repositories assigned to the html topic will be backed up.

  3. Group path: protects all repositories within the specified group or subgroup path.


Selection rule examples

The following are examples of rule patterns, along with brief explanations:

  • Pattern: yourorganization/*

    • This will match all repositories in the organization named yourorganization.

  • Pattern: yourorganization/n??

    • Matches repositories where n is followed by exactly two characters.


Regular expression patterns (regex)

All selection rules can use regular expression patterns (regex).

Regular expressions let you create flexible and adaptable rules that align with your organization's naming conventions. This approach allows precise targeting and automation based on consistent patterns in repository or project names.

The following are illustrative examples of how these rules can be applied, although the available configurations extend well beyond these cases:

  • Pattern: yourorganization/repo[0-9]+

    • This will match repositories such as repo1, repo12, repo123, and so on.

  • Pattern: yourorganization/.*data.*

    • Matches any repository name containing the word data.

  • Pattern: yourorganization/(?!.*data.*)

    • Excludes any repository name that contains the word data.

Last updated