Skip to content

composer-git-merge-driver: command not found #17

@kathi-at-datrycs

Description

@kathi-at-datrycs

I followed the documentation in the official README.md:

  1. installed the Git merge driver as a project dependency by running composer require --dev balbuf/composer-git-merge-driver
  2. executed git config -e and added
[merge "composer_json"]
    name = composer JSON file merge driver
    driver = composer-git-merge-driver %O %A %B %L %P
    recursive = binary
  1. executed vi .git/info/attributes and added
composer.json merge=composer_json
composer.lock merge=composer_json
  1. provoked a merge conflict in the composer.json and composer.lock by git merge feature-123

The files were not automatically merged, but instead the following errors occurred:

composer-git-merge-driver .merge_file_y3x1cd .merge_file_eWfOGX .merge_file_58f6Qj 7 'composer.lock': composer-git-merge-driver: command not found
composer-git-merge-driver .merge_file_9ivoFp .merge_file_3yGI0E .merge_file_vBsoyF 7 'composer.json': composer-git-merge-driver: command not found
Auto-merging composer.json
CONFLICT (content): Merge conflict in composer.json
Auto-merging composer.lock
CONFLICT (content): Merge conflict in composer.lock
Automatic merge failed; fix conflicts and then commit the result.

I solved this issue by changing the Git config to:

[merge "composer_json"]
    name = composer JSON file merge driver
    driver = vendor/bin/composer-git-merge-driver %O %A %B %L %P
    recursive = binary

Then I ran again git merge feature-123 and now the Git merge driver successfully did the job ❤️

Auto-merging composer.json
Auto-merging composer.lock

Just wanted to share this, maybe the README.md needs to get updated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions