Skip to content

Virginia-Hamra/tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create a GitHub Repo & Push Your Existing Code

  1. 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"}'
  1. 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"

Add the GitHub repo as remote

git remote add origin git@github.com:your-github-username/my-repo.git

Push code to GitHub (main branch)

git branch -M main           # optional: renames master to main
git push -u origin main

or

From inside your project directory:

git init
git add .
git commit "adding files"
gh auth login
gh auth status
gh repo create my-repo --public --source=. --remote=origin --push

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages