Skip to content

Instantly share code, notes, and snippets.

@Hardu2203
Hardu2203 / clone_sub.sh
Last active April 10, 2022 23:10 — forked from Sanix-Darker/clone_sub.sh
[BASH]clone_sub.sh
#!/bin/bash
# First parameter is the sub-directory-absolute-path
# Second parameter is the link of the repo
# A smart split to get the repo-name, with / as a separator
REPO_NAME="$(echo $2 | grep -oE '[^/]+$')"
git init $REPO_NAME
cd $REPO_NAME