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.
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.
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.