diff --git a/zsh/git.zsh b/zsh/git.zsh new file mode 100644 index 0000000..f36f1cb --- /dev/null +++ b/zsh/git.zsh @@ -0,0 +1,24 @@ +# bootstrap REPO NAME +# Create new repository from a base git repo +function bootstrap() { + local BASE="$1" + local NAME="$2" + + if [ -z "$BASE" ]; then + echo "Please provide the base repository URL." + return 1 + fi + + if [ -n "$NAME" ]; then + git clone "$BASE" "$NAME" + cd "$NAME" + rm -rf .git + git init --quiet + else + git clone "$BASE" + local REPO_NAME=$(basename "$BASE" | sed 's/\.git$//') + cd "$REPO_NAME" + rm -rf .git + git init --quiet + fi +} \ No newline at end of file