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.

相关推荐
数据猿视觉11 分钟前
宁商平台税务升级之路:合规为纲,服务为本
大数据·人工智能·microsoft
胖哥真不错1 小时前
数据集: TSPLIB旅行商问题-对称TSP数据集
大数据·机器学习·数据挖掘·优化算法·旅行商问题·tsplib·对称tsp数据集
Apache Flink2 小时前
Apache Flink:从实时数据分析到实时AI
大数据·人工智能·数据分析·flink·apache
qianmoQ4 小时前
GitHub 趋势日报 (2025年08月07日)
github
wdfk_prog11 小时前
实战教程:从“对象文件为空“到仓库重生——修复 Git 仓库损坏全记录
大数据·网络·笔记·git·学习·elasticsearch·全文检索
杨荧11 小时前
基于大数据的美食视频播放数据可视化系统 Python+Django+Vue.js
大数据·前端·javascript·vue.js·spring boot·后端·python
Hello.Reader13 小时前
以 Eland 玩转 Elasticsearch 8.12 Learning-to-Rank
大数据·elasticsearch·jenkins
ALex_zry13 小时前
Git Status 命令深度指南:洞悉仓库状态的核心艺术
大数据·git·elasticsearch
ζั͡山 ั͡有扶苏 ั͡✾13 小时前
Elasticsearch 单节点迁移实战指南:从旧服务器到新环境的完整流程
服务器·elasticsearch·jenkins
weixin_4258782314 小时前
AWS 可靠性工程深度实践: 从 Well-Architected 到“零失误”VPC 落地
大数据·云计算·aws