Changing private repository source does not recognize new tags

时间:2019-04-08 14:05:26

标签: git composer-php

I've been migrating my projects from bitbucket to github now that I can have private repositories for free on github. I migrated a repository this weekend and now I'm running into an issue where my composer file is not recognizing new tags pushed to the repository.

Here is there relevant bits of my composer.json file:

    "repositories": [
        {
            "type": "git",
            "url": "git@github.com:myaccount/myrepo.git"
        }
    ],
    "require": {
        "myaccount/myproject": "0.*"
    }

Whenever I run composer.phar update, the latest version of the project when it was on bitbucket is updated which is 0.0.4. Since then, I've added a 0.0.5, 0.0.6, and a 0.1.0 tag to the new version on github.

I've tried to delete the composer.lock file as well as the vendor directory but it still only installs the 0.0.4 tag. I've also tried clearing the composer cache with composer.phar clearcache as well as manually deleting the cache in my home directory.

I've also tried installing the project on a server that has never had composer installed. I made the requisite changes there and tried to run composer.phar update but it still only recognizes the 0.0.4 tag.

I have verified that the tags do exist in the github version.

I have also tried manually setting a tag in the composer.json file but when I do that and run composer.phar update, the operation never completes. I left it to run overnight and it still had not completed.

I've dumped the output of running composer.phar install with no lock or vendor:

Reading composer.json of myaccount/myproject (0.0.1)    
Reading composer.json of myaccount/myproject (0.0.2)
Reading composer.json of myaccount/myproject (0.0.3)
Reading composer.json of myaccount/myproject (0.0.4)
Reading composer.json of myaccount/myproject (0.0.5)
Reading composer.json of myaccount/myproject (0.0.6)
Reading composer.json of myaccount/myproject (0.1)
Reading composer.json of myaccount/myproject (0.1.1)
Reading composer.json of myaccount/myproject (master)

  - Installing myaccount/myproject (0.0.4): Cloning be03d13ed4 from cache

What am I doing wrong here?

1 个答案:

答案 0 :(得分:-1)

我最终使用git show-ref -s 0.1.1获得了标签的提交哈希。然后,我手动编辑了composer.lock文件,以更新哈希和版本。然后,我运行composer.phar install,并将其更新为正确的版本。

我仍然不知道为什么我不能说服作曲家自己弄清楚这一点。