1. First, initialize the local directory as a Git repository:
git init
  1. Add the files in your new local repository. This stages them for the first commit:
git add .
  1. Commit the files that you’ve staged in your local repository:
git commit -m "First commit"
  1. At the top of your GitHub repository’s Quick Setup page, click the clipboard icon to copy the remote repository URL.
  2. In Terminal, add the URL for the remote repository where your local repository will be pushed:
git remote add origin <remote repository URL>
  1. Verify your URL:
git remote -v
  1. Now, it’s time to push the changes in your local repository to GitHub:
git push -u origin master

Replace <remote repository URL> with the URL you copied in step 4. If you’ve done everything correctly, your local folder should now be uploaded as a new GitHub repository.