如何初始化一个线上的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
相关推荐
Nautiluss7 小时前
一起玩XVF3800麦克风阵列(八)
大数据·人工智能·嵌入式硬件·github·音频·语音识别
uhakadotcom11 小时前
Python Protobuf 全面教程:常用 API 串联与实战指南
前端·面试·github
周杰伦_Jay12 小时前
【GOFrame】模块化框架与生产级实践
开发语言·gitlab·github
托马斯-酷涛17 小时前
加速GitHub加载速度-最终篇
github·proxy·代理
yuguo.im18 小时前
5 分钟快速入门 Github Actions
ci/cd·github·actions
阿里嘎多学长18 小时前
2025-12-12 GitHub 热点项目精选
开发语言·程序员·github·代码托管
gAlAxy...19 小时前
详解 Gitee/GitHub 中 HTTPS/SSH 方式数据库仓库创建与本地连接
https·gitee·github
测试人社区-小明20 小时前
AI在金融软件测试中的实践
人工智能·测试工具·金融·pycharm·机器人·github·量子计算
CoderJia程序员甲20 小时前
GitHub 热榜项目 - 日榜(2025-12-12)
ai·开源·大模型·github·ai教程
yuguo.im20 小时前
5 分钟快速入门 Gitlab CI/CD
ci/cd·gitlab·github