【问题标题】:How to Update Deployed React App on GitHub Pages如何在 GitHub 页面上更新已部署的 React 应用程序
【发布时间】:2021-08-24 00:12:03
【问题描述】:
最近我在 GitHub Pages 上部署了我的第一个 React 应用程序
https://karan-dhingra.github.io/lct/
现在我更新了 react 应用程序,我的更改没有反映在 GitHub 页面上。但是在 Localhost 上一切都运行良好。所以,请指导我如何更新我在 GitHub Pages 上部署的 React 应用程序。
【问题讨论】:
标签:
javascript
reactjs
github
web-deployment
github-pages
【解决方案1】:
我们只需要运行 3-4 个命令
git init
git remote ****************.git [这里我们将添加以.git结尾的存储库链接,您将在您的存储库的代码选项中找到它。
npm run deploy[确保你已经安装了gh pages]
git add .
git commit -m "Here you write message while committing, you can write anything here"
git push origin master
所以,使用这些命令一切都会很好。