怎么把开源项目放到自己的github,gitee,gitea上

一、创建仓库(大部分可以不填)

二、删除.git文件夹

三、执行初始化命令(初始出.git文件夹)

在本地项目下执行命令

git init

四、与远程仓库建立关系 

git remote add origin ssh://[email protected]:61022/shengbaitong/inst_ops1.git

五、添加文件 

如果是第一次用这台电脑在这三个平台新建仓库。这一步是必须得,因为你必须得把文件添加并提交进去,不然最后合并时会报错

git add .

六、提交

git commit -m "第一次提交"

七、合并(看自己建立的分支是啥)

git push -u origin main/master

八、新平台新仓库第一次提交会输入用户名密码

如果密码错误,自己去控制面板——账户——windows凭据修改

 九、相关报错

1、执行git push -u origin main/master报错

error: src refspec main does not match any error: failed to push some refs to “”

error: src refspec main does not match any error: failed to push some refs to “”

1、原因可能就是第一次在新电脑提交代码

2、github 的默认master分支已经悄悄的变为main分支了

猜你喜欢

转载自blog.csdn.net/qq_41369135/article/details/127972749
今日推荐