VCS Operations for GIT¶
The following subsections explain the GIT operations that Virtual DataPort supports and how to use them:
Commit: see section Commit.
Push: see section Push.
Pull: see section Pull.
Revert: see section Revert.
The operations Pull, Push and Revert are available when you right-click on a database but not when you right-click another element. The reason is that these operations can only be performed over the entire repository and not just an element.
When you do a “commit”, Virtual DataPort generates the VQL of the modified elements and commits it to the local repository.
You can commit a single element (its modified dependencies will be committed as well), a folder or an entire database. To do this, right-click on an element, a folder or a database and click Commit. The Tool will display a dialog like the following:
The deleted elements are displayed with a light-gray font.
Enter a “commit message” in the text box at the top of the dialog and click Commit.
By default, the history will show the username as the author of the commit. If you want to avoid this behavior you can set the following configuration property to false:
Push is the operation to transfer commits from your local repository to the remote repository.
Next to the name of the database, the Tool displays the number of commits that have not been pushed. In the figure GIT: number of pending commits, the number of pending commits is 3. If there is no number, it means that all the commits have been pushed.
To do a push, right-click on the database and click VCS > Push. This will push all the commits performed on the selected database.
If the remote repository has commits that you have not pulled yet, the Tool will display the error: “Error pushing database: REJECTED_NONFASTFORWARD”. In this case, you have to do a pull first and then, a push.
Pull is the operation to merge the changes on the remote repository into your local repository. The pull operations are performed with a fetch followed by a rebase.
To do a pull, right-click on the database and click VCS > Pull.
When doing a pull, there might be conflicts. This happens when there are commits to be merged into your local repository and one of these commits modifies an element that you also have modified.
When this happens, the Tool will display a dialog like the following:
For each element with a conflict, select the check box of the Local column or the check box of the Remote column:
Select “Local” to keep your changes and ignore the changes of the remote repository.
Select “Remote” to overwrite your changes with the changes of the remote repository.
If a pull is going to delete elements from your local database, the Tool will display a dialog like the following:
The “revert” operation resets the local repository to a specific commit. To do so, it reverts each commit, starting from the last one, until it reaches the selected commit.
Only administrators and administrators of a database can revert to a previous version. This behavior prevents the problems that could arise if a standard user reverted to a version that would involve executing VQL statements that the user was not allowed to execute.
This only reverts elements that belong to the database (data sources, views, web services…) but it does not revert global elements (i18n or jar extensions).
To do a revert, right-click on the database and click VCS > Revert. The Tool will display a dialog like the following:
After doing a revert, you have to do a push, to transfer to the remote repository the commits that revert the changes.
To revert global elements, follow these steps:
Open the wizard to check in and out global elements: right-click on a database > VCS > Global elements. This wizard is only available to administrators.
If the database is synchronized (i.e. there are not modified elements in it), the dialog will show the Revert button. If there are modified elements, you need to check them in and start again.
Select the element you want to revert and click Revert.
The tool will list all the commits in which the selected element was committed. Select the commit to which you want to revert and click Ok.