Skip to content

Authentication

git-spice is offline-first. It does not require authentication for local stacking operations. However, once you want to push or pull changes to/from a remote repository, you will need to authenticate with the respective service.

This page covers methods to authenticate git-spice with GitHub and GitLab. Note that GitLab support requires at least version v0.9.0.

Logging in

Take the following steps to authenticate with a service:

  1. Run the following command:

    gs auth login
    
  2. Pick the service you want to authenticate with.

    Select a Forge: â–¶ github gitlab
  3. You will be presented with a list of authentication methods. Pick the one that suits you best.

Tip

Skip prompt (2) by running gs auth login inside a Git repository cloned from GitHub or GitLab.

Authentication methods

Each supported service supports different authentication methods.

Read on for more details on each method, or skip on to Pick an authentication method.

OAuth

Supported by GitHub GitLab

With OAuth authentication, you will take the following steps:

  1. Authenticate yourself on the service website in your browser.
  2. Authorize git-spice to act on your behalf on the current device only.
$ gs auth loginSelect an authentication method: OAuth 1. Visit https://github.com/login/device 2. Enter code: ABCD-1234The code expires in a few minutes.It will take a few seconds to verify after you enter it.

On GitHub, OAuth is available in two flavors:

  • OAuth: grants access to all repositories, public and private.
  • OAuth: Public repositories only: grants access to public repositories only.

For more granular control than that, use GitHub App authentication.

Note

For private repositories owned by organizations, you will need a member with administrative access to the repository to allow installation of the git-spice OAuth App.

If that is not an option, use a Personal Access Token.

For Self-Hosted GitLab instances, an administrator will need to set up a git-spice OAuth App. Be sure to uncheck the "Confidential" option when creating the App.

If that is not an option, use a Personal Access Token.

GitHub App

Supported by GitHub

With GitHub App authentication, you will take the following steps:

  1. Authenticate yourself on github.com in your browser.
  2. Authorize git-spice to act on your behalf on the current device only.
  3. Install the git-spice GitHub App on the repositories you want to use git-spice with.