Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer won't update due to changes on the current branch

We have composer as our dependency injection framework which will pull in a library we created, foobar, which works fine. The library foobar has 14 version v1.1.1 -> v1.1.14. All the way up to .12 composer updated the app fine. But now we are getting this error:

Update failed (Source directory /home/username/dev/git/appname/vendor/foorbar/library has unpushed changes on the current branch: 
Branch v1.1.14 could not be found on the origin remote and appears to be unpushed)

The composer.json:

{
  "name": "App",
  "description": "Foo Bar",
  "require": {
    "php": ">=5.3.3",
    "zendframework/zendframework": "2.2.",
    "foobarzf2lib/library": "v1.1."
  },
  "minimum-stability": "stable",
  "repositories": [
    {
      "type": "package",
      "package": {
        "name": "foobarzf2lib/library",
        "version": "v1.1.14",
        "source": {
          "url": "https://git-codecommit.eu-west-1.amazonaws.com/v1/repos/foobarzf2lib",
          "type": "git",
          "reference": "test"
        },
        "autoload": {
          "psr-4": {
            "FooBar\\" : "FooBar/"
          }
        }
      }
    }
  ]
}

More things to know:

  • Vendor is ignored in git.
  • Tried doing $ composer.phar clearcache.
  • Would be ideal to not have to delete the library every time.
like image 235
SmiffyKmc Avatar asked Nov 21 '17 14:11

SmiffyKmc


2 Answers

Remove vendor folder and reinstall packages.

like image 60
Sasha Vas Avatar answered Oct 02 '22 07:10

Sasha Vas


Branch v1.1.14 could not be found on the origin remote and appears to be unpushed) This means that wherever you're pulling the package from does not have a v1.1.14. Make sure you push v1.1.14 to the package provider and everything should be fine.

like image 44
dbrekelmans Avatar answered Oct 02 '22 09:10

dbrekelmans