diff --git a/git_project_creation.sh b/git_project_creation.sh index de396e5..d72fc3b 100755 --- a/git_project_creation.sh +++ b/git_project_creation.sh @@ -2,11 +2,6 @@ # This script will crate git project in specified location,only need to pass the name of the porject. -#if [ $(id -u) -ne 0 ] ; then -# echo "Please run script as root user" -# exit 1 -#fi - if [ $# -ne 1 ] ; then echo "Usage : $0 " exit 2 @@ -14,17 +9,14 @@ fi ProjectName=$1 -cd /home/$USER/git-linux/ - -mkdir -p ${ProjectName}.git +basedir="/home/$USER/git-linux/" -cd ${ProjectName}.git/ +mkdir -p $basedir/${ProjectName} -git init --bare +chown -R $USER:$USER $basedir/${ProjectName} -cd .. - -chown -R $USER:$USER ${ProjectName}.git +cd $basedir/${ProjectName} +git init --bare && git init +git add . && git commit -s -m "intial commit" exit 0 -