如何初始化一个线上的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
相关推荐
yyuuuzz6 小时前
aws亚马逊入门常见认知误区
运维·服务器·网络·云计算·github·aws
逛逛GitHub11 小时前
你的 Mac 就是一个 AI Agent,4B 模型本地操控电脑。
github
铁皮哥12 小时前
【后端/Agent 开发】给你的项目配置一套 .claude/ 工作流:别再裸用 Claude Code 了!
java·windows·python·spring·github·maven·生活
Resistance丶未来15 小时前
Agency-Agents 多智能体协作系统落地指南
python·大模型·nlp·github·copilot·claude·gemini
輕華15 小时前
YOLOv5 实战:从 GitHub 拉取到自定义数据集训练
yolo·github
海域云-罗鹏17 小时前
豆包开启付费订阅,想白嫖越来越难了,企业不如部署自己的算力服务器
服务器·人工智能·github
遁神银灵子18 小时前
OMO(oh-my-openagents)插件在OpenCode Desktop v1.4.33以上版本失效问题研究
github
码流怪侠19 小时前
【GitHub】TextGen:开源本地大模型运行平台的终极解决方案
python·程序员·github
小雨青年19 小时前
GitHub Copilot Commit Message 生成与自定义配置优化指南
人工智能·github·copilot
无限进步_19 小时前
【C++】AVL树完全解析:从平衡因子到四种旋转
c语言·开发语言·数据结构·c++·后端·算法·github