When working on a local project, we usually create the repository on GitHub first, copy the remote URL, and then connect it to our local project.

But there is a cleaner way to do it directly from the terminal using GitHub CLI.

1. Initialize Git in Your Project

Go to your project folder:

cd your-project-name