Which user account does Workbench use to commit changes in Git?

Git Credentials and Commit Authors

Git’s distributed nature means that there is no single repository of Git credentials that can be used for both controlling access and recording commit authors. Consider the scenario where you clone a public repository from GitHub, commit some changes, and push it to a private Git repository that is hosted in Bitbucket. In this case Bitbucket does not have any knowledge of the Git credentials used by GitHub, but the commits and authors from original GitHub repository are still visible in the Bitbucket repository’s commit history.

This is possible because Git account credentials are used to determine whether or not a user has the ability to view or modify a given Git repository but the author of a commit is identified by email address and recorded in the Git repository history. Consider the steps to commit changes in a Git repository hosted in Bitbucket:

  1. The remote Git repository is first cloned from Bitbucket to a local Git repository. Bitbucket account credentials are used during git clone to determine if the user has read access to the Bitbucket hosted Git repository.

  2. File changes are recorded as a commit in the local Git repository. The current user's email address is recorded as the author of the git commit but no Bitbucket account credentials are required as the changes only affect the local Git repository.

  3. The updated local Git repository is pushed to the remote Git repository hosted in Bitbucket. Bitbucket account credentials are used during git push to ensure that the user has write access and can update the Git repository in Bitbucket.

As illustrated by this example, Bitbucket uses Git account credentials to determine if a user has read or write access to a Git repository but the Git repository maintains a separate list of commit authors which are identified by email address.

Workbench and Git

Workbench uses a public/private SSH key as Git credentials. This is configured as part of Workbench Installation Wizard or can be changed by updating the config.yml file. The public SSH key must be added to the system hosting you remote Git repository in order grant Workbench read and write access to the required Git repositories.

Workbench Installation Wizard

Workbench Configuration File

# private key with optional passpharse, remote git access needs to be granted using public key gitAuthentication: sshKey: /opt/dm/mci/workbench.key sshPassphrase:

 

When the MettleCI Workbench performs a Git commit on a user’s behalf, the commit author email address is set based on the email address associated with the currently logged in Workbench user. Workbench user properties are automatically populated from the InformationServer’s User Directory when users first log in. However, a user can change their preferred email address at any time by editing their Workbench profile:

 

© 2015-2024 Data Migrators Pty Ltd.