如何初始化一个线上的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
相关推荐
whysqwhw10 小时前
Android Kotlin MVVM与MVI组合场景
github
whysqwhw10 小时前
MVI架构核心设计思想及实际项目应用总结
github
CoderJia程序员甲11 小时前
GitHub 热榜项目 - 日榜(2026-03-29)
人工智能·ai·大模型·github·ai教程
攀登的牵牛花11 小时前
程序员失业论,被 SWE-CI 一组数据打醒:真正先被替代的是低质量交付
前端·github
cyforkk12 小时前
Java 开源项目指南:如何规范地发布首个 GitHub Release
java·开源·github
fengci.13 小时前
ISCTF2022
github
子兮曰13 小时前
🚀24k Star 的 Pretext 为何突然爆火:它不是排版库,而是在重写 Web 文本测量
前端·javascript·github
起个名字总是说已存在16 小时前
github开源AI 拓展工具:Agent Reach
人工智能·github·dreamweaver
小雨青年17 小时前
GitHub Copilot 默认启用训练之后 企业安全如何应对
安全·github·copilot
攀登的牵牛花19 小时前
2.1w Star 的 pretext 火在哪?
前端·github