Created
July 14, 2012 13:34
-
-
Save nicerobot/3111363 to your computer and use it in GitHub Desktop.
Create new server and local repository
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 | |
# 1. Configure ~/.ssh/config with a "git" host. | |
# 2. curl https://raw.github.com/gist/3111363/server-config.git.sh | sh | |
# - step 2 will download this local script here and place the remote script | |
# Usage: ./local-new.git.sh project-name | |
[ "${1}" ] || { | |
echo "Usage: $0 repository-name" | |
exit 1 | |
} | |
ssh git "cd git; ./server-new.git ${1}" && { | |
git clone git:git/${1}.git ${1} | |
} |
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 | |
ssh git 'mkdir git && cd git && curl -O https://raw.github.com/gist/3111363/server-new.git.sh && chmod +x server-new.git.sh' | |
[ -x local-new.git.sh ] || { curl -O https://raw.github.com/gist/3111363/local-new.git.sh && chmod +x local-new.git.sh; } |
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 | |
[ "${1}" ] || { | |
echo "Usage: $0 repository-name" | |
exit 1 | |
} | |
[ -d skeleton.git ] || { | |
mkdir skeleton && { | |
( | |
cd skeleton | |
git init | |
touch README.md | |
git add README.md | |
git commit -am 'init' | |
) | |
git clone --bare skeleton skeleton.git | |
rm -rf skeleton | |
} | |
} | |
git clone --bare skeleton.git ${1}.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment