如何初始化一个线上的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
相关推荐
本地化文档18 分钟前
poethepoet-docs-l10n
python·github·gitcode·sphinx
晴天小庭1 小时前
DeepSeek Harness纯净桌面版(基于Tauri)开源,欢迎品鉴
github
苏灿烤鱼2 小时前
一套进程代替八件套,桌面更稳还是单点更大
linux·github·shell
抓不住时间的沙3 小时前
butterfly主题美化,打造属于自己的个性博客
java·开发语言·前端·javascript·node.js·github
wangruofeng3 小时前
GitHub 趋势洞察 2026-08-10~16:dsh 加冕周,11.3 万星之下生态完成分层
github·aigc·ai编程
知兀2153 小时前
hugo + PaperMod搭建博客
github
逛逛GitHub4 小时前
GLM-5.3 来了,编程能力提升 50%,两周发现 2404 个漏洞。
github
m4Rk_4 小时前
【论文阅读】Agent 记忆机制(40):HiAgent——通过子目标级记忆提升长程任务执行能力
论文阅读·人工智能·学习·开源·github
CoderJia程序员甲4 小时前
GitHub 热榜项目 - 周榜(2026-08-16)
ai·大模型·llm·github