gittee上传-解决方案

文章讲述了在将本地服务器项目上传到Gitee时遇到的pull和push失败的问题及解决方案。对于pull失败,需修改合并信息或直接跳过;对于push失败,原因是远程仓库有更新,需先执行gitpull再push。
摘要由CSDN通过智能技术生成

上传本地服务器的项目至Gitee遇到的问题

1、pull失败

  • 输入命令:git pull origin master
  • 提示信息:
  • Merge branch 'master' of https://gitee.com/user_name/test Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch. Lines starting with '#' will be ignored, and an empty message aborts the commit.
  • 提示信息解释:Git合并分支的命令,
  • 解决方案
    1.按键盘字母 i 进入insert模式
    2.修改最上面那行合并信息,改为自己的提交信息 。可以不修改
    3.按键盘左上角"Esc"
    4.输入" :wq",冒号+wq,按回车键即可
  • 注:如果不改合并信息 可以直接走3,4两步就OK
  • 上述问题解决完之后,继续使用git push -u origin master即可

2、push失败

  • 输入命令:git push -u origin master
  • 报错信息:
  • To https://gitee.com/yffannlp/cs-reasoning-metric-learning.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://gitee.com/yffannlp/cs-reasoning-metric-learning.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first merge the remote changes (e.g., hint: 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  • 解决方案:重新pull,使用git pull origin master命令,再次push,使用git push -u origin master命令即可
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值