Last active
April 23, 2021 15:57
-
-
Save apolopena/658acaee405bf77bf91124c5859e1ba3 to your computer and use it in GitHub Desktop.
zsh function snippet to setup a local and remote github repository from a branch using `gitpod-laravel-starter` as the starting point
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
# zsh function snippet | |
# | |
# Creates a new project from a branch of the repo https://github.com/apolopena/gitpod-laravel8-starter | |
# Assumes that you already have a blank repo for this project created in your github account | |
# Assumes that you want to use https instead of ssh | |
# $1: branch name to clone from | |
# $2: new repo name to clone into and push to remote (the default branch will be called main) | |
# new repo name must match the name of the blank repo you have created in github for this project. | |
# $3: GitHub username | |
__branch="$1"; __new_repo_project_name="$2"; __github_username="$3"; mkdir "$__new_repo_project_name" && cd "$__new_repo_project_name" && git clone https://github.com/apolopena/gitpod-laravel8-starter.git -b "$__branch" --single-branch . && rm -rf .git && git init && git add -A && git commit -m "initial commit built from the $__branch branch of https://github.com/apolopena/gitpod-laravel8-starter" && git remote add origin "https://github.com/$__github_username/$__new_repo_project_name.git" && git branch -m main && git push -u origin main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment