zl程序教程

您现在的位置是:首页 >  工具

当前栏目

往github提交代码流程

2023-09-11 14:17:11 时间

一 首先在Github新建一个仓库,回到首页,点击右上角的New repository新建仓库。

 

二  在本地依次使用下面命令

…or create a new repository on the command line

 
echo "# opus" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/DyLanCao/opus.git
git push -u origin master

…or push an existing repository from the command line

 
git remote add origin https://github.com/DyLanCao/opus.git
git push -u origin master

三 问题
1 输入:
git remote add origin https://github.com/DyLanCao/opus.git
上报错误:fatal: remote origin already exists.

解决方法:
首先:git remote rm origin
然后再使用命令:git remote add origin https://github.com/DyLanCao/opus.git