Uploading React Project into GitHub Repository:
Step1: Create new GitHub Repository in GitHub.
Step2: Open "vite.config.js" file in your React project and add the below line
-> "base: '/your repository name' ".
Step3: Then go to package.json file and add the below line
-> "homepage: 'https://<your-username>.github.io/<repository-name>/' ".
Step4: Open the terminal install gh pages using this command
-> "npm install gh-pages".
Step5: open the package.json file again and in the script section add the below
lines
-> "predeploy: 'npm run build' "
-> "deploy: gh-pages -d dist ".
Step6: Open the terminal add type the below commands one by one
->
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin
https://github.com/<your-username>/<repository-name>.git
git push -u origin main
Step7: And then run this command
-> npm run deploy.