Skip to content

Tips & tricks

psionides edited this page Mar 3, 2012 · 7 revisions

Tips and tricks

Cache directory

Gitifier's clones of the repositories are stored in ~/Library/Caches/net.psionides.Gitifier. In case you're wondering, cache directories are automatically excluded from Time Machine backup by OSX. Clones are created with '-n' option, which means that the master branch isn't checked out after the clone is finished, so the clone directory only contains the .git subdirectory (and since Git stores old commits in a very efficient way, this significantly reduces the directory size).

Setting SSH key to access the repository

You should be able to configure this in your .ssh/config file, like this:

Host github.com
  IdentityFile %d/.ssh/my_github_key

This should not be necessary if you have only one set of keys with the default names in the .ssh directory.

Using multiple keys with GitHub

Check out this tutorial: Multiple SSH keys.

Monitoring all GitHub activity

If you want to monitor everything that's happening in your GitHub RSS feed, GithubNotifier might be a better tool for you.

OMG, it's full of growls

Nice trick if you find your screen covered with dozens of growl notifications, which happens sometimes with Gitifier when it's set to keep growls on screen - if you alt+click the X on any of them, they will all disappear.

Check also the "Don't show more than X notifications" option in the Notifications panel.

I hate the error notifications when the network is down

You can disable the "Repository update failed" notifications only in Growl settings (see screenshot).

I want more/less commits in the history section in top menu

You can set a recentCommitsListLength key in the settings file to change the length of the list:

defaults write net.psionides.Gitifier recentCommitsListLength -int 20

Setting environment variables for git

If you set any environment variables in your .bash_profile to configure git (e.g. to make it connect through HTTP proxies), Gitifier won't be able to use it, because GUI apps in MacOSX aren't initialized the same way as console apps. To fix this problem, Gitifier checks for a key named gitEnvironment in its settings file (~/Library/Preferences/net.psionides.Gitifier.plist). If such entry exists (it needs to be a dictionary), it will pass all key/value pairs from this dictionary as ENV variables to the git process.

You can either edit this file in Property List Editor by opening the settings file in Finder, or you can do this with command line tools if you prefer:

# sets dictionary to VAR1=value1, VAR2=value2, ...
defaults write net.psionides.Gitifier gitEnvironment -dict VAR1 value1 VAR2 value2 ...

# returns the dictionary from the settings
defaults read net.psionides.Gitifier gitEnvironment   

# prints all Gitifier settings
defaults read net.psionides.Gitifier

Batch import of repositories

If you want to add more than a few repositories to Gitifier quickly, you can add them directly to the repositoryList entry in the settings file ~/Library/Preferences/net.psionides.Gitifier.plist. This entry is a list of dictionaries with name and url fields, but it will also work if you simply add the repositories as strings. Next time you launch Gitifier, it will notice that the clone directories for some of the repositories are missing and will clone them automatically.

The quickest way to do add the URLs to the list is from the command line. Prepare a file e.g. repos.txt with each repo's URL on a new line, and then call:

cat repos.txt | xargs defaults write net.psionides.Gitifier repositoryList -array-add

This is the equivalent of calling:

defaults write net.psionides.Gitifier repositoryList -array-add url1 url2 url3 ...

Which means simply "add all the strings after -array-add to the array at repositoryList in Gitifier's settings".