Git operations in HCL OneTest API
You can work with your project files that are in a Git repository from HCL OneTest™ API and
perform Git operations such as checking out files from the remote repository and committing changes
in the local repository to the remote repository. You can also set up the preferences in HCL OneTest API for
Git.
You can perform the following Git operations in HCL OneTest API:
- Checking the status of files in repositories
- Updating a project in the repository
- Delivering changes to the project in the Git repository
- Undoing changes in the local repository
- Setting preferences for Git
Note: The Git operations are enabled in the HCL OneTest API UI only
after you open the project contained in the local repository.
Checking the status of files in repositories
You can visually ascertain the connectivity between HCL OneTest API and your
project in a Git repository and check the status of the files in that project on the
repositories.
Before you begin
- You must have set up the Git repositories.
- The project files must exist in the local repository.
Procedure
Checking status in the Test Factory or Architecture School perspective views
Updating a project in the repository
You can check out the project files from the remote Git repository to your local
repository by using the UI option in HCL OneTest API. You can
use this option when you want to use the latest version of the project files from the remote Git
repository. This option performs a Git checkout of those files that have a conflict and does a Git
fetch for the other files.
Before you begin
- You must have set up the Git repositories.
- The project files must exist in the local repository.
- You must have opened the project from the local repository.
Tip: You can check if the repository is connected by looking at the Git icon (
) displayed in the Status bar. For interpreting the Git icons and numbers displayed, see
Checking the status of files in repositories.

Procedure
Results
The project files in your local repository are replaced with the version from the remote Git repository.
Delivering changes to the project in the Git repository
After you have made changes to the project files, you can deliver the changes in your
local Git repository by using the UI option in HCL OneTest API to the
project in the remote Git repository. This option performs the Git add, Git commit, and Git push
operations on the files in that project to the remote Git repository.
Before you begin
- You must have set up the Git repositories.
- The project files must exist in the local repository.
- You must have opened the project from the local repository.
- You must have made changes in the project for the files to show as changed in the HCL OneTest API UI.
Tip: You can check if the repository is connected by looking at the Git icon (
) displayed in the Status bar. For interpreting the Git icons displayed, see Checking the status of files in repositories.

Procedure
Results
The changes you made in your project files in HCL OneTest API are pushed to the project in the remote Git repository.
Undoing changes in the local repository
You can check out the project files from the remote Git repository to your local
repository by using the UI options in HCL OneTest API. Use this
option when you have uncommitted changes in the project files on your local Git repository and you
want to ignore those and reload the project using files from the remote Git repository.
Before you begin
- You must have set up the Git repositories.
- The project files must exist in the local repository.
- You must have opened the project from the local repository.
- You must have made changes in the project for the files to show as changed in the HCL OneTest API UI.
Tip: You can check if the repository is connected by looking at the Git icon (
) displayed in the Status bar. For interpreting the Git icons displayed, see Checking the status of files in repositories.

About this task
You can undo changes in your project files in the local repository by checking out the files from the remote Git repository or if the version of the project files in the remote repository has changes that you want to import into your local project.
Procedure
Results
The changes you made in your local project files in HCL OneTest API are discarded and the latest version from the remote Git repository is checked out into the local repository.
Setting preferences for Git
You can set the preferences in HCL OneTest API if your
project is in a bare Git repository by specifying the Git directory and workspace in the bare mode,
or specifying your credentials so that HCL OneTest API can access
the remote Git repository to pull or push changes.