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.

相关推荐
徐小夕8 小时前
我们用1万行Vue3代码,做了款开源AI PPT项目
github
苏同学10 小时前
LangGraph 实战:从零实现多工具协作的可追溯文档问答 Agent
github
逛逛GitHub11 小时前
给 OpenClaw 小龙虾🦞搞个像素办公室,这个 GitHub 项目有趣啊。
github
Elasticsearch15 小时前
为上下文工程构建高效的数据库检索工具
elasticsearch
武子康15 小时前
大数据-243 离线数仓 - 实战电商核心交易增量导入(DataX - HDFS - Hive 分区
大数据·后端·apache hive
doup智能AI15 小时前
数据分析师:报表自动生成与洞察——AI 员工系列 Vol.4
github
答案answer16 小时前
Three.js3D编辑器必备的相机视图插件
开源·github·three.js
RickeyBoy1 天前
Git Worktree / Worktrunk:并行 AI 开发工作流实战
github·vibecoding
逛逛GitHub1 天前
55 个 AI Agent 组成虚拟公司开源,2 天就 1 万星
github
Tapir1 天前
被 Karpathy 下场推荐的 NanoClaw 是什么来头
前端·后端·github