Created
January 28, 2012 02:56
-
-
Save brennovich/1692262 to your computer and use it in GitHub Desktop.
Criar Remote git repo
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/bash | |
# Author: Brenno Costa | |
[email protected] | |
function echo_ssh_in_authorized_keys() | |
{ | |
cat ~/.ssh/id_rsa.pub | ssh [email protected] 'cat >> ~/.ssh/authorized_keys' | |
} | |
# Setup git project bare | |
if [ $1 != -c ]; then | |
ssh $git_host 'mkdir -p ~/'$1'.git && cd ~/'$1'.git && git --bare init' | |
echo '# Add remote origin into your project folder:' | |
echo 'git remote add origin ssh://'$git_host'/~/git/'$1'.git' | |
elif [ $1 = -c ]; then | |
echo_ssh_in_authorized_keys | |
fi | |
if [ -n "$2" ]; then | |
echo_ssh_in_authorized_keys | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment