Git,本地上传项目到github

一、Git的安装和下载

https://git-scm.com/

进入官网,选择合适的版本下载

二、Github仓库创建

点击右上角New新建一个即可

三、本地项目上传

1、进入 要上传的项目目录,右键,选择Git Bash Here,进入终端Git

2、初始化临时仓库

python 复制代码
git init

对应的文件中就有.git文件,修改其中的config文件,加上名称,就是你github的名称,以及邮件

3、将文件加入到临时仓库

python 复制代码
git add *

使用git statu可以查看状态

4、提交信息

python 复制代码
git commit -m "stream"

引号中是你写的提交信息

5、连接远程仓库

python 复制代码
git remote add origin https://github.com/seeding-sun/stream-export.git

这里的url就是你新建仓库中的

6、拉取

python 复制代码
git push -u origin master

传输完成后,在master分支中就可以看到传到github中的代码了

四、可能的错误

1、 fatal: unable to access 'https://github.com/seeding-sun/yolo11.git/': Failed to connect to github.com port 443 after 2072 ms: Connection refused

跟代理设置有关

解决方案:
代理设置相关

参考:

B站:手把手教你在github上传文件

相关推荐
《小书生》10 小时前
git stash 暂存文档
git
蓝易云14 小时前
Git stash命令的详细使用说明及案例分析。
前端·git·后端
社会牛马也要做匹黑马1 天前
团队协作中Git Commit应该如何规范化
git
寻月隐君1 天前
Surfpool:Solana 上的 Anvil,本地开发闪电般⚡️
后端·web3·github
liansmo1 天前
Git与TortoiseGit在Gitee平台的应用
git·gitee
是垚不是土1 天前
JumpServer 堡垒机全流程搭建指南及常见问题解决方案
运维·安全·网络安全·github·系统安全·创业创新
F_D_Z1 天前
conda issue
python·github·conda·issue
eduics2 天前
Pull Request 中提示`commits incorrectly signed off`
gitee·github
养鱼的程序员2 天前
零基础搭建个人网站:从 Astro 框架到 GitHub 自动部署完全指南
前端·后端·github