大家使用过git克隆github仓库的伙伴应该都遇到过克隆速度很慢,还经常中断的问题;所以这里为大家分享一个快速克隆github仓库的方法,这个方法我经常也在开发工作中使用!
1.首先确保你已经安装好git命令行工具。
![9a3b15d40075746cd3d97a9d9b6dd277.png](https://i-blog.csdnimg.cn/blog_migrate/df6aaf87ddc2be3eeb93c894a37010bc.jpeg)
2.打开github网站找到你要克隆的仓库并复制仓库克隆地址。
![ebf51ab1864c448239f9ccf31a95f78d.png](https://i-blog.csdnimg.cn/blog_migrate/2b84ef877c91c3902347b969f627b2f8.jpeg)
3.打开git命令行工具输入命令:
git clone https://github.com/dcloudio/uni-app.git //这是原地址命令,这样克隆会很慢git clone https://github.com.cnpmjs.org/dcloudio/uni-app.git //更换地址域名为github.com.cnpmjs.org
![59d601d37f8fb3a06a467fb43d5af828.png](https://i-blog.csdnimg.cn/blog_migrate/53a5bd9b48b2b3e22c935e7b120c1d4b.jpeg)
这样使用第二个命令克隆就会很快,但是想继续链接远程仓库进行开发并提交代码这样就无法提交了,那我们改怎么解决呢?
4.git命令行直接修改回原仓库地址
git remote set-url origin https://github.com/dcloudio/uni-app.git //修改仓库地址git pull //拉取代码git push //提交代码
执行上面的命令行,这样就可以提交代码到远程仓库了!
好了今天就分享到这里吧,对您有帮助点个赞吧!!!