- Create the GitHub repository from terminal (using API)
# Replace "my-repo" with the name you want
curl -u your-github-username https://api.github.com/user/repos -d '{"name":"my-repo"}'Or if you have a GitHub Personal Access Token:
curl -H "Authorization: token YOUR_GITHUB_TOKEN" https://api.github.com/user/repos -d '{"name":"my-repo"}'- In your existing project folder:
cd path/to/your/project
git init # If it's not already a git repo
git add .
git commit -m "Initial commit"git remote add origin git@github.com:your-github-username/my-repo.gitgit branch -M main # optional: renames master to main
git push -u origin mainor
From inside your project directory:
git init
git add .
git commit "adding files"gh auth logingh auth statusgh repo create my-repo --public --source=. --remote=origin --push