如何初始化一个线上的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
相关推荐
程序员Soldier13 小时前
open-AutoGLM部署
github
Emma歌小白14 小时前
把代码上传到 GitHub Gist
github
逛逛GitHub14 小时前
挖到 5 个很哇塞的 AI 开源项目,快来瞧瞧。
github
CoderJia程序员甲14 小时前
GitHub 热榜项目 - 日榜(2025-12-11)
git·ai·开源·llm·github
码界奇点14 小时前
基于Python与GitHub Actions的正方教务成绩自动推送系统设计与实现
开发语言·python·车载系统·自动化·毕业设计·github·源代码管理
测试人社区-小明17 小时前
量子计算对测试未来的潜在影响:软件测试的范式变革
opencv·测试工具·pycharm·机器人·自动化·github·量子计算
uhakadotcom18 小时前
Tomli 全面教程:常用 API 串联与实战指南
前端·面试·github
lin625342218 小时前
Android仿小米视频播放器的缩放滚轮
android·git·github
mit6.82419 小时前
[Solution] Github Permission denied (publickey)
github