Created
January 30, 2009 06:37
-
-
Save lstoll/54959 to your computer and use it in GitHub Desktop.
This file contains 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 | |
if [ ! $1 ] | |
then | |
echo "You must specify the name of the repo to clone" | |
exit | |
fi | |
git clone ssh://dh/~/git/$1.git |
This file contains 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 | |
ssh dh "cd git && ls" | awk -F "." '{print $1}' |
This file contains 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 | |
# This script makes a lot of assumptions... like you have a dh ssh config. | |
if [ $1 ] | |
then | |
if [[ "$1" == '--help' || "$1" == '-h' ]] | |
then | |
echo "either run from the top dir of the repo and we'll use the directory name for the remote repo" | |
echo "or specify the name for the repo as the first param" | |
exit | |
else | |
reponame=$1 | |
fi | |
else | |
if [ ! -d '.git' ] | |
then | |
echo "Must run this from the top directory of the repo, so we can then lazily assume the remote name for the repo" | |
exit | |
fi | |
reponame=$(basename $PWD) | |
fi | |
# create the remote repo. Deny non fast forwards | |
ssh dh "cd ~/git && mkdir $reponame.git && cd $reponame.git && git --bare init && git config receive.denyNonFastforwards" | |
# add this remote as origin | |
git remote add origin ssh://dh/~/git/$reponame.git | |
# push the master branch | |
git push origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment