Search code examples
phpcomposer-php

Where is my composer global config information stored in Ubuntu?


I added a wrong github token to my global composer configuration and cannot remove it again.

I did

composer config --global --auth github-oauth.github.com myWrongTokenDamn

Now I cannot overwrite it by executing it again with the correct token and I don't know where this information is stored to remove it manually.

The command to show where it is stored just gives me the error, that I am using the wrong token. Thanks I know that....

I use Ubuntu 18.04 and installed composer following these instructions and then moving the binary to /usr/bin/composer.

Reinstalling didn't help either, so the information clearly is not stored at /usr/bin/composer


Solution

  • Weird solution:

    I noticed that the behaviour did only occur, when I was within my current project, which had of course a composer.json file

    What I did then I moved to my home directory and executed the the command again this time with the correct token:

    composer config --global --auth github-oauth.github.com myCorrectLongToken
    

    And the error message is gone.

    While I am happy about the fix, it would be good if someone could explain what happened in the background.

    Now

    $ composer config --list
    

    gives me the list of all settings including [home]

    [home] /home/myUser/.config/composer
    

    where everything is stored.