Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Jeremy Helms edited this page · 4 revisions
Clone this wiki locally

Running git-dude as daemon


@StehlikC's solution

This is my solution on OS X ( still kind of new to mac myself ). Let me know what you think, don't think it's something to add to the project though.

# run-gd - Simple script to run git-dude on mac-osx login

watchdir=$(git config dude.watchdir)

if [ -n $watchdir ]; then
    git dude $watchdir  

I created a simple script inside my ~/.git-dude/ directory called run-gd, make it exec

$ sudo chmod +x ~/.git-dude/run-gd

Add a directory to watch in your git config

$ git config --global dude.watchdir ~/repo-directory

In OS X click

Apple->System Preferences->Users & Groups->[Select User]->Login Items 

and add the shell script and mark it as hidden on launch.

Use cmd+shift+g to search for a hidden folder while in Finder.

@digitaljhelms' solution using launchd

While your PATH environment variable is usually set in a ~/.bashrc or ~/.bash_profile file, those files are only invoked for shells which are not login shells, so this poses a problem when daemonizing. Fortunately launchd uses the path_helper for constructing the PATH environment variable, so just make sure you have /etc/paths or /etc/paths.d setup properly (man path_helper for more info).

A property list file is needed to rig up launchctl to kick off the git-dude "daemon" at login using launchd. The file should live in ~/Library/LaunchAgents, use reverse domain name notation (ie, com.sickill.git-dude.plist) and contain the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
  • Depending on where you have git-dude installed, you may need to adjust the /usr/local/bin path
  • Replace {{username}} with your OS X user account name
  • If the repositories you want git-dude to watch don't live (or aren't symlinked) in the ~/.git-dude directory, specify the correct path

To test everything without constantly rebooting, run the following commands and watch your console log using

$ launchctl load ~/Library/LaunchAgents/com.sickill.git-dude.plist

If the PATH environment variable loaded by launchd using the path_helper is incorrect (you'll know because the console log will contain "command not found" errors) simply unload the file (change load to unload in the command above), make necessary changes, and run the load command again.

Something went wrong with that request. Please try again.