Git快速拉取远程项目
程序员文章站
2024-02-12 10:40:34
...
前戏
由于本地文件落后于远程仓库太多。。。,这里就不merge或者stash 了,重新clone远程仓库
克隆
很简单,执行命令即可
git clone ssh://[email protected]*****.git
...
...
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
大概等了20分钟,然后报错了,正常情况不会这样的情况,远程项目太大了,由于时间比较急,就不用其他方法了,clone最近一次吧。
git clone -b '待克隆的分支' ssh://[email protected]*****.git --depth 1
终端打印:
Cloning into 'xxx'...
remote: Counting objects: 1864, done.
remote: Compressing objects: 100% (1396/1396), done.
Receiviremote: Total 1864 (delta 729), reused 1180 (delta 413)
Receiving objects: 100% (1864/1864), 10.36 MiB | 33.00 KiB/s, done.
Resolving deltas: 100% (729/729), done.
Checking out files: 100% (1575/1575), done.
至此,已经拉取下来最近一次的代码,先将bug解决提交。
拉取
bug解决后,需要进行代码全量拉取进来执行即可。
git fetch --unshallow