For some reasons, you don't want to use your existing remote repository (repo).
You create a new GitHub's repo. How to push your current code to the new repo?
Check your remote repo URL
git remote -v origin https://github.com/ansonlowzf/your-repository.git (fetch) origin https://github.com/ansonlowzf/your-repository.git (push)
It returns the remote URL set to your project.
Remove the URL from your project
$ git remote rm origin
git remote -v
If the terminal returns nothing, it means you successfully remove the remote URL.
Create a new repository in GitHub
git remote add origin https://github.com/ansonlowzf/your-NEW-repository.git
Check the remote URL again with:-
git remote -v origin https://github.com/ansonlowzf/your-NEW-repository (fetch) origin https://github.com/ansonlowzf/your-NEW-repository (push)
If the terminal returns your new remote URL.
Congratulation, you can start push your code to the new remote URL.
git push -u origin main
📝GitHub encourages us to use origin "main" instead of origin "master". If you are so used to use the origin master. You can still set the upstream to master as you like.