首页 > 技术文章 > git码云操作

lecone 2020-09-16 09:28 原文

1.分支推送过程中突然出现 将分支推送到远程存储库时遇到错误: Git failed with a fatal error.'master' does not appear to be a git repository Could not read from remote repository.

解决方案:删除远程 再建远程。

git remote rm origin

git remote add origin https://gitee.com/xxx/xxx.git

 

https后面的地址换成自己仓库地址就可以。

 

 

在本地项目目录创建本地仓库

 git init  

输入命令后项目目录会有一个隐藏的.git文件夹

上传所有代码到本地仓库

git add.   (注意add后面有个点,与add之间有一空格)

这样就把代码上传到本地仓库了

 git commit -m "initial commit"

git remote add origin https://gitee.com/xxx/xxx.git

git push origin master

 

报错:git push origin master

 

 

执行命令:

git pull origin master --allow-unrelated-histories

git push origin master

 

推荐阅读