Created
October 4, 2021 11:58
-
-
Save tsuyo/fe5109ad1a517a6f82dc87a336396417 to your computer and use it in GitHub Desktop.
Create a git repo on local disk
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/sh | |
# variables | |
git_location=$1 | |
proj_name=`basename $PWD` | |
# error check | |
[ "${git_location}" = "" ] && echo "usage: $0 <git_dir>" && exit | |
# git commands | |
git init | |
git add . | |
git commit -m "initial" | |
git clone --bare . ${git_location}/${proj_name}.git | |
git remote add origin ${git_location}/${proj_name} | |
git remote update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment