how to create a new git repository from an existing one github code example
Example 1: git existing code to new repository
cd myapp
git init
git remote add origin https://github.com/myname/myapp.git
git add .
git commit -m "Initial commit"
git push -u origin master
Example 2: push a project to an existing repoin github using git
$ git init -b main