Skip to content

Access tokens ​

A personal access token is a password you create on the git host for one purpose. It is the credential that works everywhere over HTTPS: every supported host has a token row, and the Generic entry covers any host the list does not name, such as Gogs or Bitbucket.

If your host offers browser sign-in, OAuth is quicker. If you reach the host over SSH, you want SSH keys instead.

Create the token on the host ​

What the token needs depends on the host:

  • GitHub: a fine-grained token scoped to the repositories you need, with Contents read access, and write access if you push. Classic tokens with repo also work.
  • GitLab: a personal, project or group access token with read_repository for cloning and write_repository for pushing. Add read_api if you want the repository browser to list your projects.
  • Gitea: an access token from your account's applications page.
  • Anything else: whatever the host calls its HTTPS password or token.

Add it to HachiCode ​

  1. Settings → Git Credentials, tap +.
  2. Pick the host, or Generic for one that is not listed.
  3. Choose the token row: Personal Access Token or Access Token, depending on the host.
  4. Fill in Host, Username and the token, then tap Save.

For GitHub and GitLab the host is prefilled. For a self-hosted or Generic host, paste the base URL you sign in to; the scheme and port are optional, and both gogs.example.com:3000 and http://gogs.example.com:3000 are normalised the same way.

The token goes to the device Keychain and is only sent to the host it was saved for. The list shows each credential as host, username and method.

Use it ​

On the clone screen, turn on Require authentication and pick the credential. When exactly one stored credential matches the URL's host, it is picked for you. A project remembers its credential; change it in the project's settings.

Tap Test on the clone screen to check the token against the URL before cloning. It confirms the host accepts the credential, not that the repository exists.

Rotate a token ​

Open the credential under Settings → Git Credentials and paste the new secret under New token. The app checks it against the host before saving. The credential keeps its identity, so projects bound to it need no change.

Browse your repositories ​

With a token or OAuth credential for GitHub, GitLab or Gitea, the clone screen's Browse repositories button lists the repositories your account can see, and tapping one fills in the URL. A Generic credential cannot browse, because the app does not know the host's API. The filter above the list matches owner/name the way every list does (see Searching lists), then the repositories whose description contains what you typed.

Remove a token ​

Tap Remove credential on the credential's screen. It is refused while a project still uses the credential; the dialog names the projects. Point each of them at another credential first, or turn off Require authentication in their settings.

See also ​

Last updated: