First create a public or private repository in Github. Then open the website folder in VS Code and run the below codes in the terminal one by one.
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/username/repository-name
git push -u origin main
For existing website, run the below commands to push to the Github.
git add .
git commit -m "update"
git push
For forced push, run the below command.
git push -u origin main --force
