LoginSignup
2
3

More than 5 years have passed since last update.

anyenv updateでmergeできないエラー

Last updated at Posted at 2017-04-14

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")
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3