如何初始化一个线上的GitHub仓库,在本地已有的仓库中上传到线上

如何初始化一个线上的GitHub仓库,在本地已有的仓库中上传到线上,

首先,先创建一个线上的仓库

本地有一个曾经的仓库,或者本地git init创建一个本地仓库

根据线上仓库的主页给的提示代码进行上传

代码如下:

...or create a new repository on the command line

bash 复制代码
echo "# lyf0801.github.io" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:lyf0801/lyf0801.github.io.git
git push -u origin main

...or push an existing repository from the command line

bash 复制代码
git remote add origin git@github.com:lyf0801/lyf0801.github.io.git
git branch -M main
git push -u origin main
相关推荐
dong_junshuai3 小时前
每天一个开源项目#99 OpenResearch:2.2K星的本地研究Agent工作台
开源·github·agent
峰向AI3 小时前
背单词太无聊?这个 23K Star 的工具让你边打字边背单词,两不耽误
github
OpenTiny社区3 小时前
码力全开,智启前端新生态|OpenTiny 登陆华为全联接大会2026
前端·github
m4Rk_4 小时前
【论文阅读】Agent 记忆机制(69):STITCH——用上下文意图解决“语义相关但情境错误”的记忆检索
论文阅读·人工智能·学习·开源·github
lbb 小魔仙7 小时前
Python 项目 CI/CD 实战:用 GitHub Actions 搭建自动化测试、覆盖率与发布流水线
python·ci/cd·github
dong_junshuai7 小时前
每天一个开源项目#97 LLM Wiki:把RAG结果变成可维护知识资产
开源·llm·github
Java后端的Ai之路7 小时前
一文搞懂 GitHub Actions-CICD
开发语言·大模型·github·cicd·action
小华同学ai9 小时前
这个开源项目,有点东西!2.9 万 Star DeepTutor
人工智能·开源·github
wangruofeng1 天前
一个 Markdown 文件攒下 37k 星,i-have-adhd 给 AI 输出立了 10 条规矩
github·aigc·ai编程
怕浪猫1 天前
长会话不崩盘:DeepSeek Harness 的上下文压缩与目标管理策略
面试·github·agent