Mac/Ubuntu服务器拉取Github项目的最新版

之前未曾拉取过项目,第一次拉取:

1、先查看项目版本:
git ls-remote --tags https://github.com/zhangfanxp/zhengshu.git
(tags前面是两个-)

命令行返回信息:

d3eed8f7f685c6853de890c57d9ed93e3587b3b6 refs/tags/v3.1

edea535940ab90c210e0119af81a0b58ba5e605a refs/tags/v3.1^{}


2、拉取最新版或指定版本代码:

git clone -b v3.1 https://github.com/zhangfanxp/zhengshu.git

------------------------------------------------------------------------------------

如果拉取过程中提示错误:

Cloning into 'zhengshu'...
remote: Enumerating objects: 816, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (18/18), done.
error: RPC failed; curl 18 Transferred a partial fileMiB/s  
error: 2671 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

可以通过执行下面的命令后,再进行拉取:

git config --global http.version HTTP/1.1


==================================================
已经拉取过项目了,再拉取最新版本的代码:

1、查看本地代码与github上的差异是那些

git  pull

2、放弃所有已追踪文件的本地修改

 git checkout .


3、删除本地创建的其他文件

 git clean -fd


4、直接pull拉取最新文件

 git pull


5、删除本地的.next文件

rm  -rf  .next 

6、重新安装

npm  install

7、重新构建

npm  run  build

8、重新启动服务

npm  run  start











评论

此博客中的热门博文

通过命令行在Github上发布项目的新版本

利用GitHub免费的静态页面托管空间发布网页

本地部署OpenAvatarChat实时交互数字人系统