在conda虚拟环境安装GIT并且克隆github上项目指南(解决443问题)

此次笔记记录自己在conda虚拟环境安装git,同时克隆github项目,并且解决了git的443问题。

如有不妥欢迎各位大佬批评指正。

首先默认你已经安装了anaconda。

代开命令提示行

配置环境

python 复制代码
#首先创建虚拟环境
conda create -n git_env python=3.8
#激活虚拟环境
conda activate git_env
#安装git
conda install git
#初始化全局配置信息
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
#安装torch1.11.0(版本之间是有严格依赖关系的,安装其他版本请查看官网)
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch
#查看所有安装的包
conda list

安装Git

python 复制代码
git clone 你想要克隆的仓库路径

如何获取项目路径:打开github找到想克隆的项目→点击code->复制路径

解决443问题

报错信息:(git_env) C:\Users\93272>git clone https://github.com/google/prompt-to-prompt.git Cloning into 'prompt-to-prompt'... fatal: unable to access 'https://github.com/google/prompt-to-prompt.git/': Failed to connect to github.com port 443 after 21121 ms: Couldn't connect to server

出现此问题代表无法连接github(本人在科学上网的情况下仍然无法连接)

打开命令提示行

python 复制代码
#在命令提示行查看本机所有监听端口
netstat -ano | findstr "LISTENING"

尝试你的代理哪个能用(替换上面的http://127.0.0.1:7890),我尝试其中一个返回git网页得到html代码,说明连接没有问题。

找到可用代理后设置代理

python 复制代码
#配置代理
git config --global https.proxy socks5://127.0.0.1:7980
git config --global http.proxy socks5://127.0.0.1:7980
#查看本机代理
git config --global --get http.proxy
返回结果为:socks5://127.0.0.1:7980
#clone仓库代码
git clone https://github.com/google/prompt-to-prompt.git
成功克隆!

可通过git clone <仓库地址> D:/myproject自定义项目路径

相关推荐
u1301301 小时前
GitHub 热榜项目:日榜(2026-10-06)
人工智能·github
miofly3 小时前
Cohere推出North 2平台,主打企业AI代理可控部署
开源·github
wflynn3 小时前
GitHub 日榜趋势速报 | 2026-10-04
开源·github
wflynn3 小时前
GitHub 今日推荐|SCSKiller:游戏着色器预编译消除卡顿
开源·c#·github·nvidia·amd·directx12
行者-全栈开发3 小时前
华为云码道 CodeArts 实测:让 AI 用 Rust 写一个 Git 仓库健康度体检台「仓衡」
git·rust·tauri·桌面应用·ai 编程·华为云码道·codearts 代码智能体
miofly3 小时前
GitHub 今日推荐|lightcraft:纯 Rust 重写的 RAW 照片开发工具
rust·开源·github
wflynn3 小时前
GitHub 日榜趋势速报 | 2026-10-06
开源·github
m4Rk_4 小时前
【论文阅读】Agent 记忆机制(92):EMPO²——让 Memory 从经验复用走向主动探索
论文阅读·人工智能·学习·开源·github
用户319305698374 小时前
致敬经典!我用 HTML 复刻了一个霓虹版俄罗斯方块
github
miofly6 小时前
GitHub 日榜趋势速报 | 2026-10-07
开源·github