 <p>Here's how I would do it:</p> <pre><code>#!/bin/bash readonly Directory="$1" shift git --git-dir="$Directory/.git" "$@" </code></pre> <p>First, this copies the repository location (<code>$1</code>) to another variable (<code>$Directory</code>). Then it uses <a href="http://ss64.com/bash/shift.html" rel="nofollow"><code>shift</code></a> to move all the program arguments to the left by one, so <code>$@</code> just contains the arguments that were intended for Git. From there, it's just a simple matter of calling Git with the new arguments.</p>