DEV Community

Cover image for Upload React project on github repository from VS Code
Alyarov Faxriyor
Alyarov Faxriyor

Posted on

Upload React project on github repository from VS Code

Open your project folder on VS Code.
Install gh-pages, this module requires Git >=1.9.

npm i gh-pages --save-dev
Enter fullscreen mode Exit fullscreen mode

Create repository on your Github account
Copy repository url

git remote add origin {gitRepositoryUrl}
Enter fullscreen mode Exit fullscreen mode

Add

{
  "homepage": "{gitRepositoryUrl}",
  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  }
}
Enter fullscreen mode Exit fullscreen mode

to package.json and code

npm run deploy
Enter fullscreen mode Exit fullscreen mode

on terminal.

Top comments (0)