Created
March 8, 2023 03:38
-
-
Save mugishap/dbc7b374f74e9a87aaa6eeea5c025fae to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
rm -rf .git | |
git init | |
git add . | |
git commit -m "[init]: Initialized repo" | |
git branch main | |
git switch main | |
echo "Enter github username: " | |
read username | |
echo "Enter your github token: " | |
read token | |
echo "Enter the repo name: " | |
read repo_name | |
echo "Enter the repo description: " | |
read description | |
echo "Please wait..." | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $token"\ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/user/repos \ | |
-d "{\"name\":\"$repo_name\",\"description\":\"$description\",\"private\":true}" | |
git remote add origin "https://github.com/$username/$repo_name.git" | |
git push --set-upstream origin main | |
clear | |
echo "Repo pushed successfully | |
Happy Coding!!!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment