1.git clone 项目太大导致报错error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out
解决方案:
选择一个新的文件目录
git clone --depth=1 https://www.***.com/***.git
注意:使用了 --depth=1命令后,只会拉取默认分支的最近一次提交,无法看到提交信息及其他分支;
进一步解决:
1.先转换存储库为完整存储库
git pull --unshallow #或者 git fetch --unshallow此命令用于将
非浅层转换为完整的存储库,消除浅层存储库所施加的所有限制。2.修改
.git文件夹内config文件的[remote "origin"]节的内容修改前
[remote "origin"]
url =https://www.***.com/***.git
fetch = +refs/heads/master:refs/remotes/origin/master修改后
[remote "origin"]
url =https://www.***.com/***.git
fetch = +refs/heads/*:refs/remotes/origin/*以上步骤也可用命令代替
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"3.执行以下命令获取所有分支
git fetch -pv
2. git clone 时显示Filename too long的解决办法
运行下列命令: git config --global core.longpaths true
--global是该参数的使用范围,如果只想对本版本库设置该参数,只要在上述命令中去掉--global即可。

2101

被折叠的 条评论
为什么被折叠?



