Authentication to a Git repository
You're fully responsible for setting up and maintaining the configuration for the bring-your-own code repository method. For details, see Bring-your-own code repository.
Guidewire uses Bitbucket as the version control system. To connect with your repository in Bitbucket through Git, you need to create a personal access token and ensure that you have access to your repository. For details on how to create HTTP access tokens, see the Bitbucket documentation: Create HTTP access tokens.
Authenticate with a personal access token in Git
You can authenticate to a Git repository using the .netrc file.
The .netrc file is a mechanism that allows you to configure credentials for each server to which you connect.
To set up authentication using the .netrc file:
-
Create the
.netrcfile in your home directory.In a Windows environment, create the
_netrcfile instead. -
Add credentials to the
.netrcfile for the Guidewire VCS.machine <host_url_to_guidewire_vcs>
login <username>
password <personal_access_token>Where:
<host_url_to_guidewire_vcs>is a host URL to the Guidewire VCS (for example,bitbucket.example.com).<username>is your username in Guidewire VCS repository.<personal_access_token>is your personal access token with access to the Guidewire VCS repository.
-
Set Git credential helper to
netrcin one of the following ways:- For all the Git repositories in your system globally:
git config --global credential.<url_to_guidewire_vcs>.helper "netrc"- For a specific Git repository:
git config credential.<url_to_guidewire_vcs>.helper "netrc"Where:
<url_to_guidewire_vcs>is a URL to the Guidewire VCS (for example,https://bitbucket.example.com).
Troubleshooting
If you can't authenticate using personal access token and the .netrc file:
-
Ensure that you can connect to the Guidewire VCS from the location where the command is executed.
If the connection fails, check your IP allowlist configuration.
-
Confirm that the
.netrcfile is in your home directory. On Windows, the file is called_netrc. -
Ensure that the
.netrcfile contains correct information about host URL, username, and personal access token.machinevalue have to contain hostname of URL, without HTTP protocol. For example, usebitbucket.example.cominstead ofhttps://bitbucket.example.com.usernamehave to contain your full username in the Guidewire VCS repository.passwordhave to contain a valid personal access token with access to the Guidewire VCS repository.
-
Check if the
netrccredential helper is selected.If you set the parameter through a Git config, review them by running the
git config --listcommand. -
Verify that user linked to the personal access token has the right permissions.
- The user can access a repository on which they want to perform operations.
- For executing write operations to the Guidewire VCS, the generated personal access token includes write permission.
- If working on a branch, the user or their group have the correct branch restrictions.
For details, see Branch restrictions.