Skip to content

Commit identity and the Git guard ​

Every commit records an author name and email. In DhivaLabs Shell, each identity has its own, and a guard in its terminals stops you from committing or pushing a repository with the wrong identity.

Set the commit name and email ​

  1. Close the identity's terminals, then select it and choose Identity settings.

  2. Open Commit details (optional).

  3. Fill in Commit name (optional) and Commit email (optional) with the name and email you use on that provider.

  4. Select Save changes.

These details credit your commits; they are not used to sign in. Cloning and fetching work without them. The app never fills them in for you and never reads your global Git settings.

Use the email your provider knows for that account. On GitHub, that can be your private noreply address from the account's email settings.

How a repository is linked to an identity ​

A repository is linked to an identity when its own Git settings record that identity, its author name and email, and a push address on the identity's server.

  • Cloned with Clone repo while the identity was selected: linked automatically.
  • Cloned some other way, or already on your PC: link it with Review identity settings, below.
  1. Select the identity in the sidebar, then Clone repo.

  2. Open Use an existing repository.

  3. Next to Repository folder, select Browse… and choose the repository.

  4. Select Inspect. The result shows whether the repository matches this identity, its current author and its push remote. Repository matches this profile. means there is nothing to do.

  5. To link it, select Review identity settings. The Review repository configuration dialog lists exactly what will be written: the folder, the identity, the author and committer, the SSH key and the origin URL.

  6. Optional: to change the origin to the identity's SSH address, paste the repository's SSH address into SSH clone URL at the top of the dialog before reviewing. Leave it empty to keep the current origin.

  7. Select Apply repository settings.

The settings are written to that repository only. A backup of its Git configuration is saved first, next to it. When the result is verified, a terminal opens in the repository.

What the guard checks ​

The guard runs in every identity terminal. It does not run in Local terminal.

You runThe guard checks
git commit, merge, rebase, cherry-pick, revertThat the identity has a commit name and email, and that the repository is linked to this identity with the same author
git pushThat the repository is linked to this identity, and that the push address uses the identity's server or SSH alias

When a check fails, the command does not run and you see a red message such as Identity mismatch or Push blocked. Link the repository as described above, or open it with the right identity.

If the identity has no commit details yet, you see Add your commit name and email in Identity settings before making commits. SSH cloning does not require them.

Type identity in the terminal at any time to see the identity, author and SSH alias in use and whether the current repository matches.

Push options ​

The guard accepts these git push options, written before the remote name: -u, --set-upstream, --force-with-lease, --dry-run, -n, --tags, --all, --delete, --porcelain, --verbose, -v. Any other option is refused with Unsupported push option in guarded mode.

Options that come before the Git command, such as git -C folder status, are also refused. Use command git when you really need them: it skips the guard for that one command.

WARNING

The guard prevents accidents, not deliberate misuse. command git, another Git program, or a script can go around it. Treat it as a safety net, and still check identity before you push to an important repository.

Changing commit details later ​

If you add or change an identity's commit name or email after cloning, existing repositories still hold the old details, and the guard reports a mismatch. Run Review identity settings on each repository to update it.

Next steps ​