[go: up one dir, main page]

0% found this document useful (0 votes)
20 views1 page

Uploading React Project Into GitHub

This document outlines the steps to upload a React project to a GitHub repository. It includes creating a repository, configuring project files, installing necessary packages, and executing Git commands for deployment. The final step involves running a command to deploy the project to GitHub Pages.

Uploaded by

Tharun .s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Uploading React Project Into GitHub

This document outlines the steps to upload a React project to a GitHub repository. It includes creating a repository, configuring project files, installing necessary packages, and executing Git commands for deployment. The final step involves running a command to deploy the project to GitHub Pages.

Uploaded by

Tharun .s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

You might also like