Skip to content

Instantly share code, notes, and snippets.

@diniremix
Created June 7, 2013 14:20
Show Gist options
  • Save diniremix/5729605 to your computer and use it in GitHub Desktop.
Save diniremix/5729605 to your computer and use it in GitHub Desktop.
a shell script to create a Git repository with some default settings
#!/usr/bin/bash
clear
function createProyect(){
proyname=$1
if [ ! -d "$proyname" ];
then
echo
echo -e 'Creando nuevo repositorio de GIT: \e[1;33m'$proyname'\e[0m'
mkdir -v $proyname
echo
git init $proyname/
#curl -O https://raw.github.com/github/gitignore/master/Python.gitignore
echo
echo -e 'Creando archivos de configuracion para \e[1;32m'$proyname'\e[0m'...
touch $proyname/{.gitignore,README}
echo -e 'Construccion del Repositorio: \e[1;32mFinalizada.\e[0m'
else
echo
echo -e $0:'\e[1;36m Ya existe un directorio con ese nombre: \e[0m \e[1;31m'$proyname'\e[0m'
echo
exit 1
fi
}
if [ $# -le 0 ];then
echo
echo -e 'use: \e[1;36mcreate-repo\e[0m nombre_proyecto'
exit 1;
fi
createProyect $1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment