栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

本地代码上传gitee

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

本地代码上传gitee

本地仓库使用如下命令初始化:

$ git init

之后使用如下命令添加远程库:

$ git remote add origin git@github.com:hahah/ftpmanage.git

然后使用

$ git push -u origin master

出现如下错误:

error: src refspec master does not match any. error: failed to push some refs to ‘git@github.com:hahaha/ftpmanage.git’

引起该错误的原因是,目录中没有文件,空目录是不能提交上去的

解决方法:

  1. touch README
  2. git add README
  3. git commit -m ‘first commit’

最后执行$ git push -u origin master

如果出现这个错误:Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

可能是暂存区没有文件,通过git add操作可以添加到暂存区以便commit。

运行 $git add .成功把文件存到暂存区

接下来继续运行$git commit -m 'first commit’将暂存区的代码提交到本地仓库

最后成功push到GitHub上面 $git push origin master

如果push中出现如下错误:: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

.这可能是是由于你的git地址采用了ssh方式,切换为https方式

在终端中输入:

$ git remote set-url origin https://github.com/YourUserName/YatouTest00123.git

然后再push一下

$git push -u origin master

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/293019.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号