Connect a Git host

Sign in to GitHub, GitLab or OneDev with its CLI so DiffNode can read pull requests and publish reviews under your account.

DiffNode works with GitHub, GitLab and OneDev through each platform's own command-line tool. It reads pull requests, fetches the repository and, when you confirm, publishes comments. It never stores your Git token: it uses the login the CLI already has.

Sign in with the platform's CLI

DiffNode never signs in or installs a Git CLI for you. Install the CLI and sign in in a terminal on the computer that runs the reviews.

HostCLISign in
GitHubghgh auth login
GitLabglabglab auth login --hostname and your host
OneDevtodtod config set
  • GitHub: on macOS you can install gh with brew install gh. The GitHub integration always uses github.com.
  • GitLab: on macOS you can install glab with brew install glab. Use your GitLab address as the host, for example glab auth login --hostname gitlab.example.org.
  • OneDev: download tod from your OneDev server's help menu and put it on your PATH.

Then choose Git under the environment in the left panel (it reads, for example, "Git · 1") to open Git integrations, and choose Refresh status. Each card shows the account, the publishing identity, write access, the host and when it was last checked. Settings on a card changes its name and, for GitLab and OneDev, its host.

DiffNode checks the logins again in the background every 30 minutes. It only reads; it never switches accounts.

What permissions you need

DiffNode reads with your login and publishes with the same login. To publish, the token must be allowed to write, and your account needs a role in the repository.

HostTokenYour role in the repository
GitHubgh auth login, or a classic token with the repo scopeAt least read (pull) access
GitLabA personal token with the api scopeAt least Reporter
OneDevAn access token for tod; on a server, with the Has Owner Permissions option, which you confirm once in DiffNodeA role that manages the project or pull requests, or writes code

Some logins are read only:

  • GitHub: a token without repo cannot publish. public_repo is enough only for public repositories. DiffNode cannot read the permissions of a fine-grained token, so it shows them as not verified.
  • GitLab: a token with only read_api or read_repository cannot publish.
  • OneDev: OneDev does not report what a token may do, so write access may show as not verified.

When you add a repository, DiffNode shows whether your login has write access there, is read only, or has write access not verified. Whatever DiffNode cannot prove is never treated as write access.

Who publishes

Reviews are published as the signed-in Git account, not as the AI that wrote them. The AI account and the publishing account are separate. The publication preview always names the account that will post, for example Publishes as @you.

  • On this computer: the desktop publishes with the Git login of this computer.
  • On a server: a server has its own Git logins, signed in on the server. It publishes its own reviews only if you turn on Server may publish with its own Git login for that environment, and only to repositories its login can provably write to. Otherwise this computer publishes them with your Git identity, after you confirm, and only to repositories you approved for that server.

Nothing is published without a preview. By default you confirm every publication yourself; see Automation modes for the exceptions you can turn on.

DiffNode publishes comments and, only if you turn it on, approves or requests changes. It never merges. See Approvals.

What each host gets

HostInline commentsSummary
GitHubA comment review on the changed linesOne summary comment, edited in place on later reviews
GitLabComments on the changed linesOne summary note, edited in place on later reviews
OneDevCode comments on the changed linesA summary comment; a changed summary is posted as a new one

The Publication style setting can also post everything as a single comment instead. See Review behavior.

GitLab drafts

On GitLab, DiffNode publishes a review at once through GitLab's draft comments, so the merge request gets one notification. GitLab publishes all of your drafts in that merge request together. If you have your own unpublished draft comments there, DiffNode stops before posting anything and asks you to submit or discard them in GitLab. Then choose Retry publication.

OneDev approvals

On OneDev, DiffNode can request changes but does not approve, because an approval there cannot be tied to the reviewed commit.

Troubleshooting

  • No Git integration when you add a repository: sign in with the CLI, then choose Check again or Refresh status.
  • If DiffNode says your login cannot see the repository, the signed-in account has no access to it. Sign in with an account that has access.
  • write access not verified: DiffNode could not prove the token may write. Check the token's scopes and your role in the tables above.