Adding locally hosted code to GitHub - GitHub Docs
If your code is stored locally on your computer and is tracked by Git or not tracked by any version control system (VCS), you can import the code to GitHub using GitHub CLI or Git commands.
docs.github.com