Git Perspective

Icon: git perspective

Keyboard shortcut: CTRL+SHIFT+G (CMD+SHIFT+G on macOS)

Description

The Git perspective shows the branches, tags and commit history of your project. It is available when the project folder is a git repository. To commit your changes, use the Git commit perspective. See Working with git for the other git options in Hop Gui.

The perspective has four parts:

  1. On the left, the branches and tags: Local, Remote and Tags. A search field above Local, Remote and Tags filters the commit list by message, author and abbreviated id.

  2. In the middle, the commit history: a graph of the branches, with their names next to the commits they point to, and the message, author, date and id of each commit. When you have uncommitted changes, they are shown as the first line.

  3. On the right, the files changed in the selected commit.

  4. Below them, the differences in the selected file.

Branches and tags

Right-click a branch or tag on the left:

action description shortcut

Checkout

Check out the branch or tag.

Create branch from

Create a new branch that starts at this branch or tag.

Merge into

Merge this branch into the current branch.

Fetch

Fetch from the remote. Available on any branch or tag.

Pull

Pull the current branch from the remote. Offered only when a local branch is selected.

Push

Push the selected local branch or tag. Not available on a remote-tracking branch.

Rename

Rename a local branch, or a remote-tracking branch other than the remote’s default branch. Not available on a tag.

F2

Delete

Delete the branch or tag.

DEL

The commit history

The toolbar above the history refreshes it, creates a branch or tag at the selected commit, cherry-picks the selected commit, and fetches, pulls (CTRL+T) and pushes. Its eye button shows or hides commits that are only reachable from other local branches.

Right-click a commit for more:

action description

Create branch, Create tag

Create a branch or a tag at this commit.

Checkout Revision

Check out this commit.

Copy Revision Id

Copy the id of the commit to the clipboard.

Reset current branch to here

Move the current branch to this commit. You choose what happens to the changes made after it: keep them staged (soft), keep them unstaged (mixed) or discard them (hard).

Revert commit

Create a new commit that undoes this one.

Cherry-pick commit

Apply this commit to the current branch.

The files of a commit

Select a file in the changed files to see its differences below. The toolbar above the files and their right-click menu act on the selected file:

action description shortcut

Show text diff

Show the changes in the file as text.

CTRL+D

Show visual diff

For a pipeline or workflow, open the versions before and after the commit side by side.

CTRL+SHIFT+D

Copy Path

Copy the path of the file to the clipboard.

Revert file

Undo what this commit did to the file, and commit that.

Cherry-pick file

Take the version of the file in this commit, and commit it.