Created
August 18, 2014 19:31
-
-
Save Tantas/cd77cec4b6389e99dd92 to your computer and use it in GitHub Desktop.
List and clone gitolite repos using ssh keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# List and clone gitolite repos using ssh keys | |
# Note: 'privategit' is a host found in ~/.ssh/config | |
# List the available repositories if no argument | |
if [[ "$#" -ne 1 ]]; then | |
echo "Provide the name of the project to clone" | |
echo "Available projects are:" | |
ssh privategit info 2>/dev/null | tail -n +3 | awk '{ print $3 }' | |
exit 0 | |
fi | |
# Clone the repository | |
git clone "ssh://privategit/$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment