宝塔中更新github

git remote -v

宝塔中如果执行出错:报错git config --global --add safe.directory

(执行:git config --global --add safe.directory /www/wwwroot/tool.xxx.com)

在执行git remote -v即可

origin https://github.com/xxx/whz-tool.git (fetch)

origin https://github.com/xxx/whz-tool.git (push)

origin:远程仓库的本地别名

ijoanne888:GitHub 用户名

whz-tool:GitHub 仓库名

你服务器如果 git remote -v 也是这个地址,那么拉取代码就用:

git pull origin main

其中 origin 是远程别名,main 是分支名。

GitHub 用户:ijoanne888

│

└── GitHub 仓库:whz-tool

│

└── 你本地给它起的名字:origin

origin 只是你当前电脑里,对这个远程 Git 仓库起的一个"昵称"。

git pull origin main

npm run build

pm2 restart whz-too

(whz-too 是 Node/Next.js 进程名)

通过终端 pm2 ls 输出结果中的name 就是node的进程名

如果 package.json 或 package-lock.json 有变化,则:

git pull origin main

npm ci

npm run build

pm2 restart whz-tool

git pull

↓

把最新源代码拉下来

npm run build

↓

生成最新 .next

pm2 restart whz-tool

↓

让网站真正运行最新版本

相关推荐
u1301303 小时前
GitHub 热榜项目:日榜(2026-10-21)
人工智能·github
逛逛GitHub5 小时前
盘点本周 11 个 Star 攀升最多的 GitHub 开源项目。
github
蒲公英内测分发5 小时前
智能门锁量产时,工厂测试 App 一直在更新,产线怎么避免装错 APK?
服务器·人工智能·github·智能硬件·智能手表
本地化文档6 小时前
llvm-libc-docs-l10n
c语言·github·gitcode·sphinx·llvm·crowdin
wflynn6 小时前
GitHub 日榜趋势速报 | 2026-10-21
开源·github
钱栈up8 小时前
GitHub热榜上手|Claude插件:4.3万星官方目录
python·开源·github
大狼鲸8 小时前
阿里云ECS自动快照怎么配置?新手数据备份避坑指南
阿里云·云计算·github
wflynn8 小时前
GitHub 日榜趋势速报 | 2026-10-19
开源·github
高频因子挖掘机8 小时前
A股量化第一步:如何利用 QuantDash 实现日K数据清洗、前复权校验与缺失值处理
后端·github·api
miofly10 小时前
GitHub 今日推荐|pandacode:本地桌面统一管理多个AI编码代理
rust·开源·github