Estimated reading time: 8 minutes
The Git integration feature is based on EGit. You can refer to http://wiki.eclipse.org/EGit/User_Guide for detailed user guide regarding EGit.
What is Git?
Git is a powerful and popular system for version control. It is one of the essential tools for collaboration in software development teams. If your Katalon Studio automation project involves several or more members, you should use Git or another source control system for managing change and configuration on your project. Below are several specific benefits of using Git for your Katalon Studio projects.
- Git allows to undo mistakes
- The undo ability gives project teams the courage to try out ideas and concepts without worrying about the risk of breaking stuff, and thus, fosters a culture of innovation.
- Git makes the team progress clearer
- A commit in Git refers to a change in automation scripts that a team member makes, indicating the progress of tasks.
- Git supports comparing versions of code to show differences between commits. It is useful to review a commit before it officially becomes final.
- Git supports working offline
- Being to work offline makes your team more fail-safe. Each member can perform everything on his/her computer, independent from possible infrastructure downtime.
- Never losing data ever again
- As daily work can be committed to the remote Git server, every team member working on a project has a full-fledged copy on his/her machine, including the project's complete change history.
- If any backup breaks down: just restore it using any team member's local repository or Git repository.
With Git, a repository can be shared to multiple members in a team to help to improve the team's collaboration and productivity.
Katalon Studio integration with Git introduction
Git Integration is a powerful feature of Katalon Studio for collaboration between team members in test automation projects using Git. This tutorial presents a typical workflow for Git integration with Katalon Studio:
- Enable Git Integration. In order to access all Git features, you need to enable Git Integration first. The option is available at following settings: Window > Katalon Studio Preferences > Katalon > Git. Once enabled, you can start using Git at Katalon Studio main toolbar.
2. Now the Git integration feature should be enabled. We are ready to use Git from Katalon Studio.
- Advanced configurations are available at Window > Preferences > Team > Git in case you want more specific setups.
Clone a Katalon Studio project from a Git repository
After enabling Git Integration, you can clone an existing Git repository into a newly created directory on the local machine.
Select Clone Project from Git menu of the main toolbar.
The Source Git Repository dialog will be displayed. Where:
Field Description Repository URL The URL to your Git repository (Should be in HTTPS protocol). Username The username to access the Git repository. Password The password to access the Git repository.
Enter all required information and click the Next button to let Katalon Studio gets details about your repository.
If you cannot access the repository after clicking Next button, the connection may have issues with SSL verification. You can use below command to bypass SSL verification (NOT recommended):
git config --global http.sslVerify false
At Branch Selection screen, you can choose which branches to be checked out as local branches. Click the Next button to continue.
At Local Destination dialog, specify the local location for cloning as well as the initial branch.
Field Description Directory The local storage location you want to store your Git's repository. Initial branch All selected branches from the previous step will be displayed here. Select the branch to be used initially from this list.
Click Finish when you are done. Katalon Studio will automatically open your cloned project.
To verify settings, go to Window > Katalon Studio Reference > Repository Settings. Ensure that the Repository is selected correctly with URL specified.
Publish a local non-Git project as a Git repository
Share Project is a step to enable Git configuration for you new Katalon Studio project.
Select Share Project from Git menu of the main toolbar.
Folder .git and file .gitignore will be created within the Katalon project.
.gitignoretells Git which files (or patterns) it should ignore. By default, .gitignore content will contain these files and patterns:
/bin /Libs .settings .classpath /.svn
The Commit option allows users to view all current changes and decide which changes to be stored in local branch. Refer to https://git-scm.com/docs/git-commit for detailed Git documentation regarding Commit command.
Select the Commit option from Git menu of the main toolbar.
The Git Staging tab will be display for configuration. Where:
Field Description Unstaged Changes Changes which have been made. Staged Changes Selected changes from Unstaged Changes. These changes will be committed.
From the Unstaged Changes list, select the changes to be committed, then right-click on them and select Add To Index. Selected changes will be added to the Staged Changes list.
Enter your comments into the Commit Message then click on Commit to store your staged changes into the local branch.
Select the New Branch option from Git menu of the main toolbar.
The Create Branch dialog will be displayed. Where:
Field Description Source
Select either remote or local branch which will be your source branch.
Branch name The name to be used for the new branch. Checkout new branch Option to let Katalon Studio checkout that branch after created.
Click Finish to create new branch.
The Checkout Branch option allow you to switch from one branch to another.
Select the Checkout Branch option from Git menu of the main toolbar.
The Select Source dialog will be displayed. Select the local branch you want to check out to be current branch. The branch with √ icon is your current local branch.
Click OK to finish checking out to new local branch.
Select the Delete Branch option from Git menu of the main toolbar.
On this dialog, both local and remote branches are displayed. Select a branch to be deleted then click OK.
Retrieve all information about changes occurred in remote branches. Refer to https://git-scm.com/docs/git-fetch for detailed Git documentation regarding Fetch command
Select the Fetch option from Git menu of the main toolbar.
It will automatically fetch remote branches, tags, and remote changes.
Select History from main toolbar
Details regarding all the branches and tags you've just fetched will be displayed.
Incorporate changes from a remote repository into the current branch. Refer to https://git-scm.com/docs/git-pull for detailed Git documentation regarding Pull command
Select the Pull option from Git menu of the main toolbar.
In the Pull dialog, select the remote branch to be pulled into your local branch. Click Finish.
The Pull Result dialog will be displayed with all data about pulling request taken on the selected branch.
Update remote branch using the local branch. Refer to https://git-scm.com/docs/git-push for detailed Git documentation regarding Push command
Before doing any push, you have to commit your changes first.
Select Push option from Git menu of the main toolbar.
The** Push to Branch **dialog will be displayed. Choose from the Remote branch list which branch to be updated (All remote branches in your Git repository are listed here).
Click Next after finished selecting your remote branch.
If you enter a different name besides the listed branches, a new remote branch with that name will be created accordingly.
The Push ConfirmationDialog will be displayed with details regarding your commit. Click on Finish to push your commits to the remote repository.