Working with git

Version control is an important aspect of any serious data orchestration project. Hop wants to make it as easy as possible to manage versions for your workflows and pipelines through the integrated git options in the File Explorer perspective.

File Explorer Toolbar

If you open the file explorer for a project that is not version controlled in git, the git icons in the file explorer’s main toolbar (top left) will be shown as greyed-out and disabled.

No git available

If git was found (ie the project has a .git folder in the project root), these buttons in this toolbar are enabled.

Git toolbar

The available options to work with files and the available git operations in this toolbar are briefly discussed below.

icon action description shortcut

arrow right

Open selected file

Opens the selected file in the appropriate editor (pipeline or workflow editor for workflows and pipelines, text editor for other files

double-click

folder add

Add folder

adds a new folder at the selected location. A popup is shown for the folder name

delete

Delete Selected File

Deletes the selected file

DEL

rename

Rename the selected file

Makes the selected file name editable to allow renaming

F2

refresh

Refresh

Refreshes the projects folder and file structure

git info

Git info

Populates the file explorer’s git dialog with version information for the selected file.

git add

Git Add

Add the selected file to version control

git revert

Git Revert

Revert file to last committed version (HEAD)

git commit

Git commit

Commit the latest changes for the selected file (providing a commit message)

push

Git push

Push the recent changes to the remote repository

pull

Git pull

Pull the latest changes from the remote repository

Only the available options are availabe at a given time. E.g. git add will not be available for files that already are in version control.

File Explorer Tree

In the folder and file structure tree below the toolbar, files use a color coding scheme to indicate the git status of a file:

  • black: unchanged. This is the latest version of the file available in git, no changes detected.

  • grey: this file is ignored

  • blue: staged for commit. This file is ready to be committed ('Git Commit')

  • red: not staged for commit. Add this file to git before changes can be committed ('Git Add').

Working with files in git

Add a file

Click on a file that is not yet staged for commit (red), click 'Git Add'. The color of the file changes to blue (staged for commit).

Commit a file

Click on a file that is staged for commit (blue), click 'Git Commit'. A popup dialog will ask to confirm the file to commit, and will show a popup for your commit message. Change the default 'Commit Message' to a commit message that describes the changes you made to the file. The file color changes to black (no changes).

Show git info

Click on a file that is under version control (black or blue). The file explorer will show the git status for this file: the file or folder, status, branch and a revisions table (list of previous commits). Select one of the available commits to show the changed files to show the changed files for that revision. Select any of the files in the revision from the 'Changed files' list to show the git diff information on the right hand side. For workflows and pipelines, click 'Visual diff' to open the file in the Data Orchestration perspective. Hop will show an additional icon in the upper right corner of the action or transform icon to indicate the git change that was made (green for added or yellow for changed)

Git visual diff