GitKraken Desktop Documentation​

Downloads  
Contact support  
Feedback  
GitKraken.com  
GitKraken Status  

Diff, Patch, Blame, and History

Compare changes within GitKraken Desktop diffs. Learn where to access diffs, and how to access file history or file blame.


What is a diff in GitKraken Desktop?

A diff shows what was added or removed from a file. Red is for lines where content was removed whereas green is for new lines added.

GitKraken Desktop’s diff comes included with the following:

  • Word diffing
  • Syntax highlighting
  • File mini-map
  • Toggles between Hunk View, Inline View, and Split View
  • Arrows to move between change sets

Most importantly, the button allows you to edit this file directly. Learn more about this feature in Editing Files section.


Where can I access the diff?

Access the diff of a file from:

  • Staging: Click on a file
  • Commit node: With a commit node selected, click on any file

If you have two commits selected, GitKraken Desktop shows the difference between the two commits.

Additionally, select multiple commit rows in the graph using Shift Click to show its merged diff:

Hunk view

Hunk view will show the diff as blocks, without the context of the rest of the file.

Inline view

Inline view will show the diff within the context of the entire file.

Split view

Split view will show a side by side diff comparing how the file looked before (left), and how it looks after the change (right). Note, you may select deleted lines with your mouse from split view.


External diff tools

Configure your preferred external diff tool from Preferences General:

GitKraken Desktop currently only supports the following diff tools:

  • Beyond Compare
  • FileMerge
  • Kaleidoscope
  • KDiff
  • Araxis
  • P4Merge

If your diff tool from the list above is installed and is not showing up in the dropdown, then look for an option to install command line tools.

If you would like to use another diff tool, navigate to Preferences General and set the Diff Tool to Git Config Default. Then open your global .gitconfig file and add these additional lines to use that diff tool. Here are some examples for each operating system:

Mac OS

[diff]
    tool = meld
[difftool "meld"]
    cmd = open -a Meld --args "$LOCAL" "$REMOTE"

Linux

[diff]
  tool = meld
[difftool "meld"]
  cmd = meld "$LOCAL" "$REMOTE"

Windows

[diff]
  tool = meld
[difftool]
  prompt = false
[difftool "meld"]
  cmd = meld "$LOCAL" "$REMOTE"

Diff multiple commits

Use the Shift or Cmd/Ctrl key to select multiple commits in the graph.

This will produce a combined diff, which lists all files that were added, modified, renamed or deleted between the selected commits in the Commit Panel.

Note: Are you looking to diff branches? Consider using the Cmd/Ctrl key to select the head commits of each branch.


Diff a WIP

When you have a Work in Progress (WIP), you can diff this against any commit or branch by ctrl/command clicking the WIP and then the other desired commit. Alternativley, with your WIP sleected, you can right-click the desired commit or branch and select compare commit against working directory.


File Blame and History

File History and File Blame information display in the same view.

To access either option, click to view the file diff and the options will appear in the upper right.

You may also click on a commit in the graph and then right click a file to access File History or File Blame. File History shows that file’s commit history on the left.

File Blame will color code the commit author of each line or hunk.

Use the top toggle button to switch between Diff View, which shows the selected commit’s changes to the file, and the File View, which shows the file’s state at that commit, including the blame info.

Patch

A patch, or patchfile, is a file describing changes between 2 files. Patch files can be used to distribute changes that a given user would like to make to a particular revision without codifying it onto a git server. Patches can be created from either a commit(s) or a file(s).

To create a patch from a commit, right-click a commit and select Create patch from commit. You will be prompted to name the patch after.

To create a patch from a file, right-click a file and select Create patch from file changes. You will be prompted to name the patch after.

You can also multi-select files or commits by holding command/ctrl or shift and clicking. You can then right-click the selected files or commits to create a patch from the selected.

To apply a patch, use the keyboard shortcut command/ctrl + Shift + P or click the in the top right of the UI to bring up the Command Palette. Type “Apply Patch” to summon the “Apply Patch” command, and select it to open your file explorer.

Select your .patch file to then apply changes to your working directory.

Note: GitKraken Desktop does not yet support generating patches from binary files. This is a preliminary release with better support coming, and if you have feedback please reach out to our support team.

Have feedback about this article? Did we miss something? Let us know!
On this page