Is there an indicator for watching a git repository and get notification on commit, push, ... ?
Searching "indicator ubuntu git watch repository" send me a lot of indicator hosted on github... can't find anything usefull for this...
22 Answers
I think what you want is git-dude.
git-dude
git-dude is a simple git desktop notifier. It monitors git repositories in current directory for new commits/branches/tags and shows desktop notification if anything new arrived.
How it works
It simply uses git fetch and parses its output to see what has changed. Then it
formats new commit messages with git log and shows desktop notification withnotify-send / kdialog (Linux) or growlnotify (OSX). All of this in infinite loop.
How does it look
Fedora (Gnome-Shell) :
Ubuntu:
Requirements
On Linux:
notify-sendon Gnome (Fedora: libnotify package, Ubuntu: libnotify-bin package)kdialogon KDE (included in KDE)
On OSX:
growlnotify, from Growl Extras(Homebrew: growlnotify package)
Installation
$ curl -skL >~/bin/git-dude
$ chmod +x ~/bin/git-dude* Make sure ~/bin is in your $PATH or put git-dude script somewhere else
on your $PATH.
Usage
git-dude iterates over repositories that live inside the dude directory. This directory is nothing more than container for cloned repositories of projects you want to watch. Name it like you want, here for example we use~/.git-dude:
$ mkdir ~/.git-dude
$ cd ~/.git-dudeClone some repositories:
$ git clone --mirror
$ git clone --mirror git://I recommend git clone --mirror - it doesn't checkout working directory so it
saves some disk space for bigger projects.
Symlinked repositories work too. This way you can monitor already cloned projects:
$ ln -s ~/code/tmuxinator .Now run this to monitor pwd:
$ git dudeYou can also pass directory name as first argument to specify which directory to monitor instead of pwd.
$ git dude ~/watched-reposThis way you can have multiple dude directories each being monitored by separate git-dude process.
Configuration
Global
Set how often git-dude should check for changes (in seconds, default: 60):
$ git config --global dude.interval 30Set path to icon used by desktop notifications (default: none):
$ git config --global dude.icon ~/.git-dude/github_32.pngSet custom notification command ($TITLE, $DESCRIPTION and $ICON_PATHenvironment variables are set when invoking notification command):
$ git config --global dude.notify-command 'gntp-send "$TITLE" "$DESCRIPTION" "$ICON_PATH"'
$ git config --global dude.notify-command 'echo -e "$TITLE\n\n\n$DESCRIPTION" | espeak --stdin -k20 -ven+12'Per-repository
Set path to icon used by desktop notifications for this repository (default: taken from global setting):
$ git config dude.icon ~/.git-dude/dm-core/datamapper.pngTell git-dude to ignore specific repository (if you want to unmonitor it):
$ git config dude.ignore trueAuthor
Marcin Kulik ( | @sickill)
To track notifications use Recent Notifications indicator.
In a terminal run:
sudo add-apt-repository ppa:jconti/recent-notifications
sudo apt-get update
sudo apt-get install indicator-notificationsAfter installing run Alt+F2 unity --replace.
You will find a little mailbox in the panel:]
I wrote a little python program that does what you're looking for. It's a bit rough around the edges, so I'd appreciate any feedback you might have.
To use it, run git-indicator from a directory that contains one or more git repositories (like you'd use git-dude).
Example:
~$ git clone ~/.git-indicator
~$ cd ~/repos
~/repos$ ls
repo1 repo2 repo3
~/repos$ ~/.git-indicator/git-indicator.py & 4