diff --git a/docs/updating.md b/docs/updating.md index 092c17963..fe745e4ef 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -61,7 +61,21 @@ setting you use. ## Preventing Commit of Merge Conflicts -If you use `--conflict rej` (the default): +If you use `--conflict inline` (the default) then you need to check for conflicts +markers in your files: + +```yaml title=".pre-commit-config.yaml" +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + # Prevent committing inline conflict markers + - id: check-merge-conflict + args: [--assume-in-merge] +``` + +If you use `--conflict rej` then you need to review and remove all generated `.rej` +files: ```yaml title=".pre-commit-config.yaml" repos: @@ -70,17 +84,19 @@ repos: # Prevent committing .rej files - id: forbidden-files name: forbidden files - entry: found Copier update rejection files; review them and remove them + description: + found Copier update rejection files; review and remove them before + merging. language: fail files: "\\.rej$" - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 - hooks: - # Prevent committing inline conflict markers - - id: check-merge-conflict - args: [--assume-in-merge] ``` +!!! note + + For projects that use both `rej` and `inline` depending on each user's preference, + you can add both hooks to your `pre-commit-config.yaml` file, making sure that no + unresolved merge conflicts are committed. + ## Never change the answers file manually !!! important