Skip to content

Commit

Permalink
Create git project direcotry with initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
  • Loading branch information
unixbhaskar committed Jul 26, 2022
1 parent 2e419e2 commit c3bb669
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions git_project_creation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,21 @@
# 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 <project name>"
exit 2
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

0 comments on commit c3bb669

Please sign in to comment.