push github

一、生成密钥

打开git bash执行下面指令,Enter下一步Enter下一步..生成ssh key 密钥;

复制代码
ssh-keygen -t rsa

二、 复制公共密钥到git hub

登录github,在选项setting >> SSH and GPG key >> add new ssh添加刚才的公钥地址即可

验证是否成功:

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

出现 You've successfully authenticated, but GitHub does not provide shell access.则成功连接

三、Push 文件github

1、打开文件目录,右键选择gitbash

2、初始化仓库

复制代码
git init

3、添加到本地仓库

复制代码
git add .

4、提交文件到本地仓库

复制代码
git commit -m "frist commit"

提交到本地库并备注为frist commit,此时变更仍在本地

5、增加一个远程服务器的别名

复制代码
git remote add origin git@github.com:WuhAICFly/fly.git

git branch -M master

git push -u origin master

参考命令:

复制代码
git add README.md #添加文件到本地仓库
git rm README.md #本地倒库内删除
git commit -m "first commit" #提交到本地库并备注,此时变更仍在本地。
git commit -a  ##自动更新变化的文件,a可以理解为auto
git remote add xxx git@github.com:xxx/xxx.git  #增加一个远程服务器的别名。
git remote rm xxx   ##删除远程版本库的别名
git push -u remotename master #将本地文件提交到Github的remoname版本库中。此时才更新了本地变更到github服务

精简版:

一、将在GitHub上更改的内容更新到本地

1、在GitHub上修改完后记得保存

2、进入你本地建立的文件夹,右键git bash here

3、输入pwd确认位置后,输入git pull origin

4、查看本地是否更新成功

二 、将在本地更新后的代码上传到GitHub

1、更改本地文件

2、在本地文件夹下右键git bash here,

3、输入pwd确认位置

4、输入git add .

5、输入git commit -m 'update'

6、输入git push

7、打开GitHub查看是否成功

相关推荐
用户7273744138844 小时前
JSON 转义字符到底该怎么读:几种常见场景
github
SL_staff5 小时前
考勤同步工资核算总出错?破解企业级精准自动化的三个刚性支点
mysql·github·全栈
webxin6666 小时前
汽水music自动看广告领取VIP
程序员·github
梦里寻码6 小时前
给 AI Agent 搭围栏:Monorepo 是被低估的 Agent 基础设施
前端·后端·github
穆梓兰煊7 小时前
Flutter端云协同推理架构解析
flutter·github
七牛云行业应用9 小时前
DeepSeek Harness 自定义 Skill 教程:从 SKILL.md 到可复用 Agent 工作流
算法·github
逛逛GitHub9 小时前
清华在 GitHub 上开源的 Agent 工作台,最近更新了 2.0 版本。
github
u13013011 小时前
GitHub 热榜项目:日榜(2026-10-14)
人工智能·github
誰能久伴不乏12 小时前
QT工业上位机一次「指令静默丢失」的排查
qt·docker·github
胡大伟12 小时前
麦当劳的开发者大赛:麦当劳 MCP 实测——一个藏在 inputSchema 里的参数
github