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.
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:
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 ↓
CTown
September 19, 2011 at 4:15 am (UTC 0) Link to this comment
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!
Jonathan Thomas
September 19, 2011 at 7:25 am (UTC 0) Link to this comment
As a note, the (K)Ubuntu package is called “kdesdk-dolphin-plugins”. 😉
sdoerner
September 19, 2011 at 9:42 pm (UTC 0) Link to this comment
Thanks, fixed that.
rieper
September 19, 2011 at 7:55 am (UTC 0) Link to this comment
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.
Elvis Stansvik
September 19, 2011 at 9:26 am (UTC 0) Link to this comment
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.
sdoerner
September 19, 2011 at 9:57 pm (UTC 0) Link to this comment
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)?
Vdragon
May 18, 2014 at 9:40 am (UTC 0) Link to this comment
Hi, I really like to see git-mv integration too, I both needed to rename/move-to-other-directory.
ruurd
September 19, 2011 at 10:07 am (UTC 0) Link to this comment
KEWL! Like it. Do you have any plans to also show additional columns in detail view perhaps?
sdoerner
September 19, 2011 at 9:56 pm (UTC 0) Link to this comment
The interface of dolphin doesn’t support that at this time. What information besides the version state would you find useful to display?
Yngve
September 19, 2011 at 1:29 pm (UTC 0) Link to this comment
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.
sdoerner
September 19, 2011 at 9:49 pm (UTC 0) Link to this comment
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?
The User
September 19, 2011 at 8:37 pm (UTC 0) Link to this comment
Does it already work with Dolphin from master? Can’t find the backends in the kde-baseapps-repository.
sdoerner
September 19, 2011 at 9:45 pm (UTC 0) Link to this comment
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.
Vishesh Yadav
September 21, 2011 at 9:18 am (UTC 0) Link to this comment
As of 10th Sep, Dolphin master supports Version Control Plugins again. There are few small things left, but mostly they should work fine.
geegee
April 6, 2016 at 7:36 am (UTC 0) Link to this comment
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???
sdoerner
April 7, 2016 at 10:05 pm (UTC 0) Link to this comment
Right-click in the white space in a directory, rather than on a file.
Un plugin aggiunge il supporto a Git su Dolphin | News Blog di Caelan
September 21, 2011 at 5:03 pm (UTC 0) Link to this comment
[…] Via | Life & everything […]
Un plugin aggiunge il supporto a Git su Dolphin | CorryL's Blog
September 21, 2011 at 5:41 pm (UTC 0) Link to this comment
[…] Via | Life & everything […]
Un plugin aggiunge il supporto a Git su Dolphin | Indipedia – Indipendenti nella rete
September 22, 2011 at 9:00 am (UTC 0) Link to this comment
[…] Via | Life & everything […]