> ## Documentation Index
> Fetch the complete documentation index at: https://code.storage/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# createGitCredential()

> Store a Git credential for a repository configured with a generic HTTPS Git provider.

<CodeGroup>
  ```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  const credential = await store.createGitCredential({
    repoId: repo.id,
    username: 'git',
    password: 'YOUR_ACCESS_TOKEN_OR_PASSWORD',
  });

  console.log(credential.id);
  ```

  ```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  credential = await storage.create_git_credential(
      repo_id=repo.id,
      username="git",
      password="YOUR_ACCESS_TOKEN_OR_PASSWORD",
  )

  print(credential.id)
  ```

  ```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  credential, err := client.CreateGitCredential(context.Background(), storage.CreateGitCredentialRequest{
  	RepoID:   repo.ID,
  	Username: "git",
  	Password: "YOUR_ACCESS_TOKEN_OR_PASSWORD",
  })

  fmt.Println(credential.ID)
  ```
</CodeGroup>

## Options

<ParamField path="repoId" type="string" required>
  The ID of the repository to attach the credential to.
</ParamField>

<ParamField path="username" type="string">
  Git username. Optional for providers that accept a token without a username.
</ParamField>

<ParamField path="password" type="string" required>
  Git password or access token used to authenticate with the upstream provider.
</ParamField>

## Response

<ResponseField name="id" type="string">
  The credential ID. Use this to update or delete the credential later.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when the credential was created.
</ResponseField>

## Related

* [updateGitCredential()](/docs/reference/sdk/update-git-credential)
* [deleteGitCredential()](/docs/reference/sdk/delete-git-credential)
* [Integrations](/docs/guides/integrations)
