Configuring Git

Pushing to your repositories with FoundriesFactory® is a matter of configuring Git to use Fioctl™ as a credential helper. Afterwards, Git will know when you are connecting to source.foundries.io and will use Fioctl for authentication when utilizing git commands.

Setting Up Git

Run the following command to add the relevant entries to the Git configuration:

sudo fioctl configure-git

Important

This needs to be run as sudo instead of directly as the root user. This is because it needs to have privileges to create a symlink in the same directory as where git is located.

Warning

  • If for some reason the command fails with an error, the following manual steps can be taken to get the exact same result:

    git config --global credential.https://source.foundries.io.username fio-oauth2
    git config --global credential.https://source.foundries.io.helper fio
    ln -s /usr/bin/fioctl /usr/bin/git-credential-fio
    
  • Existing users reconfiguring Git access may need to remove the following lines from .gitconfig to use fioctl configure-git utility:

    [http "https://source.foundries.io"]
    extraheader = Authorization: basic <TOKEN>
    
  • If editting scopes on existing tokens, the user should refresh the local fioctl credentials with:

    fioclt login --refresh-access-token
    

Verify that this has been successful by cloning a repository from your Factory, such as your containers.git repo. Replace <factory> with your Factory’s name:

git clone https://source.foundries.io/factories/<factory>/containers.git

Tip

You can also use git config --global --list to show the current state of the global Git configuration, where source.foundries.io should be referenced along with a username and a helper.