how to connect to an existing git repository to a project code example
Example 1: git add existing project to repository
git remote add origin <repository url>
git branch -M main
git push -u origin main
Example 2: push a project to an existing repoin github using git
$ git init -b main