Git怎么将文件夹上传至github,全过程

小白建议参考github文件上传全流程-新手入门系列(超详细!!!)

中间可能会有报错

$ ssh -T git@github.com

ssh: connect to host github.com port 22: Connection timed out

这时,参考,如何解决:ssh: connect to host github.com port 22: Connection refused ,即可解决。

正式开始

先在文件夹下面右击运行git bush here,打开命令窗口,测试是否可以链接到github

Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes

复制代码
ssh -T git@github.com

Hi Jie-Bai! You've successfully authenticated, but GitHub does not provide shell access.

Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes

复制代码
git config --global user.name "Jie-Bai"

Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes

复制代码
git config --global user.email "jee_bai@163.com"

Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes

复制代码
 git init

Initialized empty Git repository in E:/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes/.git/

Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes (master)

复制代码
git add .

Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes (master)

复制代码
 git commit -m "TGRS work files"

master (root-commit) 7066848\] TGRS work files 156 files changed, 25787 insertions(+) create mode 100644 "ExampleFiles/\\350\\257\\225\\351\\252\\214XXXXX_X_0_Y_0_20221019_18_30_45_ch23_3_556.csv" create mode 100644 create mode 100644 Rclonte-M/finalParas.xlsx create mode 100644 measuredDataDecompositionRclonte_M.py Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes (master) git remote -v Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes (master) 替换为自己要上传的仓库的git链接 git remote add origin git@github.com:Jie-Bai/Rclonte-M-TGRS.git Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes (master) git push -u origin master Enumerating objects: 165, done. Counting objects: 100% (165/165), done. Delta compression using up to 16 threads Compressing objects: 100% (165/165), done. Writing objects: 100% (165/165), 15.49 MiB \| 1.70 MiB/s, done. Total 165 (delta 73), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (73/73), done. remote: remote: Create a pull request for 'master' on GitHub by visiting: remote: https://github.com/Jie-Bai/Rclonte-M-TGRS/pull/new/master remote: To github.com:Jie-Bai/Rclonte-M-TGRS.git * \[new branch\] master -\> master branch 'master' set up to track 'origin/master'. Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes (master) $ #### 以下内容为为了防止上面链接【[如何解决:ssh: connect to host github.com port 22: Connection refused](https://blog.csdn.net/hjy_mysql/article/details/131596257) 】消失而截图保存的一些内容,主要为创建SSH以及和本地链接的过程。 Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes $ ssh-keygen -t ed25519 -C "jee_bai@163.com" Generating public/private ed25519 key pair. Enter file in which to save the key (/c/Users/Lenovo/.ssh/id_ed25519): Created directory '/c/Users/Lenovo/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/Lenovo/.ssh/id_ed25519 Your public key has been saved in /c/Users/Lenovo/.ssh/id_ed25519.pub The key fingerprint is:..................... The key's randomart image is: .............................. \|.o. \| \|...E. . \| \|... .o o o . \| \|. o. = = o \| \|. . o.= S o \| \| + *.* B . \| \|o +.@ + \* . . \| \| ...o X . B . \| \| ...\* o o. \| ±---\[SHA256\]-----+ Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes $ ssh -T git@github.com ssh: connect to host github.com port 22: Connection timed out https://blog.csdn.net/hjy_mysql/article/details/131596257 ![在这里插入图片描述](https://file.jishuzhan.net/article/1747757672465174530/08646cc135c355ec97a4c24c3a4b9364.webp) Host github.com Hostname ssh.github.com Port 443 ![在这里插入图片描述](https://file.jishuzhan.net/article/1747757672465174530/fa3aaf76ba0c3f343391abfa0f36ed94.webp) ![在这里插入图片描述](https://file.jishuzhan.net/article/1747757672465174530/7196f1bd174c9b18d6b5b709ec817d9b.webp) ![在这里插入图片描述](https://file.jishuzhan.net/article/1747757672465174530/63a18163288d6486c8a6a9634f09bee5.webp) ![在这里插入图片描述](https://file.jishuzhan.net/article/1747757672465174530/bf5e22769e536fd8c65c5ebcedc18098.webp) ![在这里插入图片描述](https://file.jishuzhan.net/article/1747757672465174530/23e9c31ebebec451e2c5c69ca8049530.webp) Lenovo@hero MINGW64 /e/AIRCAS/CopenSourceCode/3 Rclonte-M-TGRS/Codes $ ssh -T git@github.com The authenticity of host '\[ssh.github.com\]:443 (\[20.205.243.160\]:443)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/\[fingerprint\])? y Please type 'yes', 'no' or the fingerprint: yes Warning: Permanently added '\[ssh.github.com\]:443' (ED25519) to the list of known hosts. Hi Jie-Bai! You've successfully authenticated, but GitHub does not provide shell access.

相关推荐
草莓熊Lotso33 分钟前
Git 分支管理:从基础操作到协作流程(本地篇)
大数据·服务器·开发语言·c++·人工智能·git·sql
间彧9 小时前
Kubernetes声明式API相比传统命令式API在故障恢复场景下的具体优势有哪些?
kubernetes·github
5***o50010 小时前
Git在代码中的GitHub
git·github
GIS数据转换器12 小时前
GIS+大模型助力安全风险精细化管理
大数据·网络·人工智能·安全·无人机
hg011812 小时前
今年前10个月天津进出口总值6940.2亿元
大数据
MarvinZhang13 小时前
LeanSpec:一个轻量级的 SDD 框架
架构·开源·github
byte轻骑兵13 小时前
时序数据库选型指南:从大数据视角看IoTDB的核心优势
大数据·时序数据库·iotdb
Leo.yuan14 小时前
制造业都在说BOM,为什么BOM这么重要?
大数据·bom·企业数字化·数字赋能
能鈺CMS14 小时前
内容付费系统全面解析:构建知识变现体系的最强工具(2025 SEO 深度专题)
大数据·人工智能·html
徐小夕15 小时前
耗时一周,我把可视化+零代码+AI融入到了CRM系统,使用体验超酷!
javascript·vue.js·github