Git operations in DevOps Test Integrations and APIs
You can work with your project files that are in a Git repository from IBM® DevOps Test Integrations and APIs (Test Integrations and APIs) 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 Test Integrations and APIs for Git.
- 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
Checking the status of files in repositories
You can visually ascertain the connectivity between Test Integrations and APIs and your project in a Git repository and check the status of the files in that project on the repositories.
- You must have set up the Git repositories.
- The project files must exist in the local repository.
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 Test Integrations and APIs. 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.
- 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.
- Updated the project files in your local repository with the version from the remote Git repository.
- Retained your changes in the files by resolving the merge conflict state by using your preferred Git method.
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 Test Integrations and APIs 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.
- Set up the Git repositories.
- Ensured that the project files exist in the local repository.
- Opened the project from the local repository.
- Made changes in the project for the files to show as changed in the Test Integrations and APIs UI.
- If no new files are shown as present in the remote repository, you can continue with working on your project.
- If new files are shown as present in the remote repository, then you must perform the Update Project action to fetch the latest files from the remote repository.
After you complete making changes to your project files and you want to commit your files to the remote repository, you can use the Deliver changes option.
If... | Then... | Result... |
---|---|---|
You want to merge the changes in the files. |
You must perform the merge operation outside of Test Integrations and APIs by using your preferred Git method. |
Files in the local and remote repositories are merged. The changes that you made in your project files are retained in the merged files. |
You want to use the files in the remote repository and discard the changes you made in your project files. |
Perform the following actions:
|
The changes in your project files are discarded and files in the local repository are updated with the files from the remote repository. After you deliver the changes, files in the remote repository are updated and both repositories have the same files. |
-
To use the Menu option, complete the following steps:
-
To use the Git options in the Logical View (Tree View) of the
Architecture School perspective, complete the following steps:
-
To use the Git options in the Test Factory perspective, complete the
following steps:
-
To use the Git options in the Physical View of the
Architecture School perspective, complete the following steps:
The changes that you made in your project files in Test Integrations and APIs 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 Test Integrations and APIs. 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.
- Set up the Git repositories.
- Ensured that the project files exist in the local repository.
- Opened the project from the local repository.
- Made changes in the project for the files to show as changed in the Test Integrations and APIs UI.
You can undo changes in your project files in the local repository by checking out the files from the remote Git repository. When you perform the Undo changes action in your project, the open editors in your project are refreshed and the files in the local repository are updated. All files that you had changed are discarded and are replaced with the files from the remote repository.
-
To use the Menu option, complete the following steps:
-
To use the Git options in the Logical View (tree view) of the
Architecture School perspective, complete the following steps:
-
To use the Git options in the Test Factory perspective, complete the
following steps:
-
To use the Git options in the Physical View of the
Architecture School perspective, complete the following steps:
The changes that you made in your local project files in Test Integrations and APIs are discarded and the latest version from the remote Git repository is checked out into the local repository.
Setting preferences for Git
You can specify the Git directory and workspace when you are setting Git in the bare mode or specify your credentials to access the remote Git repository by using the Preferences option in Test Integrations and APIs. You can also configure the Secure Shell (SSH) settings or the name of the remote repository.