Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 2.69 KB

gitlab.md

File metadata and controls

53 lines (39 loc) · 2.69 KB

GitLab support

Git Credential Manager supports gitlab.com out the box.

Using on a another instance

To use on another instance, eg. https://gitlab.example.com requires setup and configuration:

  1. Create an OAuth application. This can be at the user, group or instance level. Specify a name and use a redirect URI of http://127.0.0.1/. Unselect the 'Confidential' option. Set the 'write_repository' and 'read_repository' scopes.
  2. Copy the application ID and configure git config --global credential.https://gitlab.example.com.GitLabDevClientId <APPLICATION_ID>
  3. Copy the application secret and configure git config --global credential.https://gitlab.example.com.GitLabDevClientSecret <APPLICATION_SECRET>
  4. Configure authentication modes to include 'browser' git config --global credential.https://gitlab.example.com.gitLabAuthModes browser
  5. For good measure, configure git config --global credential.https://gitlab.example.com.provider gitlab. This may be necessary to recognise the domain as a GitLab instance.
  6. Verify the config is as expected git config --global --get-urlmatch credential https://gitlab.example.com

Clearing config

    git config --global --unset-all credential.https://gitlab.example.com.GitLabDevClientId
    git config --global --unset-all credential.https://gitlab.example.com.GitLabDevClientSecret
    git config --global --unset-all credential.https://gitlab.example.com.provider

Preferences

Select an authentication method for 'https://gitlab.com/':
  1. Web browser (default)
  2. Personal access token
  3. Username/password
option (enter for default):

If you have a preferred authentication mode, you can specify credential.gitLabAuthModes:

git config --global credential.gitlabauthmodes browser

Caveats

Improved support requires changes in GitLab. Please vote for these issues if they affect you:

  1. No support for OAuth device authorization (necessary for machines without web browser): GitLab issue 332682
  2. Only domains with prefix gitlab. are recognised as GitLab remotes: GitLab issue 349464
  3. Username/password authentication is suggested even if disabled on server: GitLab issue 349463