zoukankan      html  css  js  c++  java
  • ! [rejected] master -> master (fetch first)

    在将本地的master分支首次部署到远程的gitlab上面时,我们用git push -u origin master 命令执行报错如下:

    ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'ssh://git@g.hz.netease.com:22222/XXXXX/fastmonkey.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 integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    
    出错的原因:gitlab中READE.md文件不在本地代码目录中
    解决方法: $ git pull
    --rebase origin master $ git push origin master
    此时就可以了:    

    注意:

       push之前需要先pull代码合并一下,再去push
  • 相关阅读:
    jenkins持续集成
    对pm2对研究
    模板⽅法模式
    python configparser模块
    Python正则表达式
    Python读写文件之换行符
    Python字符串
    Python字典
    Python列表
    爬虫 urllib,requests,lxml,bs4 小结
  • 原文地址:https://www.cnblogs.com/amberdyy/p/11400143.html
Copyright © 2011-2022 走看看