如何初始化一个线上的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
相关推荐
ModestCoder_3 小时前
本地配置github登录与远程clone
github
星驰云3 小时前
LLS OAI 项目级会话记录模式 — 为 GitHub Copilot Chat 打造的智能日志助手:一键生成工作日志,告别繁琐汇报
github·copilot
redreamSo5 小时前
让AI Agent自动接Issue、写代码、上线:我用200行代码搭了一个全自动开发流水线
人工智能·开源·github
weixin_514253189 小时前
430-aguvis tmux
github
JAVA面经实录91710 小时前
Java开发工程基础完整手册(企业实战完整版)
java·开发语言·git·ci/cd·svn·github·intellij idea
zh_xuan10 小时前
github远程library仓库升级
android·github
本地化文档10 小时前
rust-nomicon-l10n
rust·github·gitcode
Maynor99611 小时前
Codex 中国站正式上线!
人工智能·gpt·macos·github
本地化文档11 小时前
setuptools-docs-l10n
python·github·gitcode
小白依旧白11 小时前
git clone --mirror命令说明
github