Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kathi-at-datrycs opened this issue Jan 28, 2025 · 1 comment
Open

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

kathi-at-datrycs opened this issue Jan 28, 2025 · 1 comment

Comments

@kathi-at-datrycs
Copy link

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?

@davereid
Copy link

davereid commented Feb 6, 2025

I had to use the full path to the driver, so it looked like this:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants