»

Sep 19

A git plugin for Dolphin

The commit dialog of the git plugin

A while ago, I was contacted by a user who only accidentially found out about the git plugin I wrote for Dolphin almost a year ago. He pointed out that Google, the magic gate to the internet, did not immediately provide a conclusive answer about the existance of this plugin and how to activate it. This post is about to fix that problem.

So, what to expect from a git plugin for Dolphin? Dolphin is the well-known file manager for KDE and can be used to manage all the files and folder on your computer. If you are a programmer, some of these folders will probably be checkouts of a version control system, such as git or Subversion. There are several actions to interact with these systems, such as adding new files to the repository, making commits or checking out specific versions. The usual way to trigger these actions is via the command line. For convenience, Dolphin offers the most frequently used ones in its context menu, so far for SVN and git. Furthermore, the version control states of the files, such as “added to the repository” or “modified since the last commit”, are indicated for each file with icon overlays.

New context menu items
Version Icons directly in the file browser

Enabling the git plugin
To enable this functionality, you first need to install the plugins. They are part of KDESDK, here are some package names for common distributions:

  • (K)Ubuntu: kdesdk-dolphin-plugins
  • openSUSE: dolphin-plugins
  • Arch Linux: extra/kdesdk-dolphin-plugins
  • Gentoo: kde-base/dolphin-plugins

Now, you can enable the plugins in the dolphin settings:

Dolphin's settings menu
The dolphin services config window

After you restart Dolphin, you should see both icon overlays and the new context menu entries whenever you enter a folder that is managed by git.

[Update]Notice that remote access (push / pull) currently only works for authenticated remote repositories and users, i.e. your SSH key must have access to the repository and you should have confirmed the public SSH key of the remote repository on the console before. Password-based login is also not possible at this time.[/Update]

This post is mainly about the git plugin, but there are also other version control systems. The very first plugin to be supported was Subversion (svn), introduced in KDE 4.4. As part of this year’s Google Summer of Code, Vishesh Yadav implemented a plugin for Mercurial, which will be part of KDE 4.8. I also spotted a Bazaar plugin in the KDESDK trunk. So, if you are into programming, be sure to check out the next version of KDE!

16 comments

3 pings

Skip to comment form

  1. CTown

    Thanks for the tip and the git plugin. Never noticed that Dolphin’s services are configurable. Isn’t Dolphin an amazing program; it’s simple, its powerful, and it looks good!

  2. Jonathan Thomas

    As a note, the (K)Ubuntu package is called “kdesdk-dolphin-plugins”. 😉

    1. sdoerner

      Thanks, fixed that.

  3. rieper

    thanx a lot for the post. however, after a quick try, it fails for me for both git and svn. no dialog shows up to enter my crendentials (ssh-key). maybe you could update the post with what to do when handling password/ssh-key protected repositories.

  4. Elvis Stansvik

    Cool. Would it be possible to add some kind of support for git-mv? I’m keeping my school work in git repos and find that I move/rename files and directories in these repos quite often.

    1. sdoerner

      I think supporting basic renaming would be quite easy. Do you just use it for simple rename or also to move files around in the repository (move to other sub-folders)?

      1. Vdragon

        Hi, I really like to see git-mv integration too, I both needed to rename/move-to-other-directory.

  5. ruurd

    KEWL! Like it. Do you have any plans to also show additional columns in detail view perhaps?

    1. sdoerner

      The interface of dolphin doesn’t support that at this time. What information besides the version state would you find useful to display?

  6. Yngve

    Nice work! I noticed one thing (apologies if this was already fixed/mentioned, I use KDE 4.7). When I right click a file which is already in the version control, the “git add” button is greyed out. This is wrong for git in my opinion, since “git add” still makes sense for these files.

    1. sdoerner

      Git add only makes sense if there are local changes. If the file is different from what is currently in the index, “git add” is not greyed out. Am I missing some case where it makes sense even if there are no changes?

  7. The User

    Does it already work with Dolphin from master? Can’t find the backends in the kde-baseapps-repository.

    1. sdoerner

      Since Dolphin master has recently seen a major update, the plugins might not be working yet. This will be fixed for KDE 4.8 of course, but since I currently have only few time for KDE development, I don’t know the exact current state of master in this regard.

    2. Vishesh Yadav

      As of 10th Sep, Dolphin master supports Version Control Plugins again. There are few small things left, but mostly they should work fine.

  8. geegee

    Hi,

    i have added my public key to the server and can ssh in without being prompted and also push and pull automatically but still i only get the “Git Add” and “Git Remove” in the Dolphin right click menu.

    how can i enable the other options like push, pull etc in the Dolphin menu like shown in your screenshot???

    1. sdoerner

      Right-click in the white space in a directory, rather than on a file.

  1. Un plugin aggiunge il supporto a Git su Dolphin | News Blog di Caelan

    […] Via | Life & everything […]

  2. Un plugin aggiunge il supporto a Git su Dolphin | CorryL's Blog

    […] Via | Life & everything […]

  3. Un plugin aggiunge il supporto a Git su Dolphin | Indipedia – Indipendenti nella rete

    […] Via | Life & everything […]

Leave a Reply to geegee Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>