Skip to content

Instantly share code, notes, and snippets.

@benhosmer
Created April 20, 2012 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benhosmer/2429595 to your computer and use it in GitHub Desktop.
Save benhosmer/2429595 to your computer and use it in GitHub Desktop.
A shell script to change permissions of the gitolite repositories to make them readable by GitPHP
#!/bin/sh
GITOLITE_REPO_PATH="/home/gitolite/repositories"
GITOLITE_ADMIN_PATH="$GITOLITE_REPO_PATH/gitolite-admin.git"
debug ()
{
echo "[D]: $1" > /dev/null
}
for dir in `find $GITOLITE_REPO_PATH -type -d`; do
if [ "$dir" != "GITOLITE_ADMIN_PATH" ]; then
`chmod -R 0755 $dir`
fi
debug "Permissions changed for all repositories."
done
@kevinkhill
Copy link

I am trying to find a solution for this problem too and I stumbled across your script here. I seem to have encountered some issues with it, so I made a few tweaks and thought I would share.

#!/bin/sh

GITOLITE_REPO_PATH="/home/gitolite/repositories/"
GITOLITE_ADMIN_REPO="gitolite-admin.git"

debug ()
{
        echo "[D]: $1"
}

for dir in `find $GITOLITE_REPO_PATH -mindepth 1 -maxdepth 1  \( ! -name $GITOLITE_ADMIN_REPO \)`; do
        `chmod -R 0755 $dir`
        debug "Permissions changed for $dir"
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment