Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

anyenv updateでmergeできないエラー

More than 3 years have passed since last update.

php7.1.4がでたのでインストールしようとanyenv update したらこんなエラーがでた。

$ anyenv update
Updating 'anyenv'...
Updating 'anyenv/anyenv-update'...
Updating 'phpenv'...
Updating 'phpenv/php-build'...
 |  From https://github.com/php-build/php-build
 |  6da869a..85a1dcf  master     -> origin/master
 |  * [new branch]      xdebug     -> origin/xdebug
 |  error: Your local changes to the following files would be overwritten by merge:
 |  share/php-build/definitions/7.1.0
 |  share/php-build/definitions/7.1.3
 |  Please commit your changes or stash them before you merge.
 |  Aborting
 |  Failed to update. Use 'verbose' option for detailed, or 'force' option.
Updating 'phpenv/phpenv-composer'...

どうやらanyenv updateは、git pull してるだけのよう(たぶん)で、昔修正したdefinitionsとコンフリクトしている模様。

git stashでいったん退避してanyenv updateしたらいけた。

$ cd ~/.anyenv/envs/phpenv/plugins/php-build
$ git stash
$ anyenv update
Updating 'anyenv'...
Updating 'anyenv/anyenv-update'...
Updating 'phpenv'...
Updating 'phpenv/php-build'...
Updating 'phpenv/phpenv-composer'...

最後にgit stash applyで退避した変更をもどしておく。

$ git stash apply
Auto-merging share/php-build/definitions/7.1.3
Auto-merging share/php-build/definitions/7.1.0
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   share/php-build/definitions/7.1.0
    modified:   share/php-build/definitions/7.1.3

no changes added to commit (use "git add" and/or "git commit -a")
EC-CUBEの開発をしています ※Qiitaへ投稿した記事はすべて私個人としての発言です。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away