首页 > 其他分享 >git push origin master出错:error: failed to push some refs to

git push origin master出错:error: failed to push some refs to

时间:2022-11-25 17:56:43浏览次数:63  
标签:origin pull git refs master push

1.输入git push origin master

出错:error: failed to push some refs to

那是因为本地没有update到最新版本的项目(git上有README.md文件没下载下来)

本地直接push所以会出错。

2.所以本地要输入git pull

然后出现的英语提示'git pull <repository> <refspec>'显示要选择远程分支

2.就试试指定目标到远程分支

输入git pull origin

出现提示

but did not specify
a branch. Because this is not the default configured remote
for your current branch

3.,重置pull origin!

输入git pull --rebase origin master

成功update到最新文件

4.输入git push origin master

整个项目就上传到coding云了

5.还是得多学英语才能再stackoverflow混

参考资料

git error: failed to push some refs to

 

See git-pull(1) for details

 

    git pull <remote> <branch>

比如git pull origin master

从远端origin拉取master分支的内容然后合并到当前所处的本地分支。直接git pull的话默认远程库是orgin,默认远程库的分支是master。 

If you wish to set tracking information for this branch you can do so with:

 指定远程分支

    git branch --set-upstream-to=origin/<branch> master

比如我们设置远程库origin的master分支

git branch --set-upstream-to=origin/master

git push origin master出错:error: failed to push some refs to - 一斗才 - 博客园 (cnblogs.com)

标签:origin,pull,git,refs,master,push
From: https://www.cnblogs.com/nightminer/p/16925914.html

相关文章

  • GitlabRunner+K8S 实现自动化发布
    前置条件:一台Linux服务器,安装好Docker一个K8s集群环境一个Gitlab仓库,可以自己搭建或者直接使用官方仓库(中文版gitlab:https://jihulab.com/)一个镜像仓库,用于存储doc......
  • git pull 命名显示无权限
      重新设置本地公钥,并设置到对应的仓库地址上面我使用的是coding可以看https://coding.net/help/docs/repo/ssh/config.html ......
  • Gitlab 安装与配置
    参考:Gitlab安装与配置Gitlab安装使用docker-compose安装Gitlab,traefik反向代理Gitlab,并开启https编辑docker-compose.yaml文件注意将YOU_XXX换成符合要求的名......
  • git 关于clone下载失败
    一、前言我的电脑一直录入的是我的gitee账号,平常和同事协作开发,gitpull、gitclone等git操作都没有报错过。但是,今天要gitclone另一个gitee账号的项目代码,出现报错403(如......
  • Git常见命令
    基本操作初始化\新建仓库gitinit添加追踪的文件gitadd[filename1][filename2]...更新,重新储存gitrestore[filename1][filename2]...将暂存区的......
  • 用好SVN与Git,不然很容易跑路的
    介绍一下SVNSVN:代码控制器(版本控制器),主要是为了多人协同开发项目,管理代码。也可以管理个人代码。也叫程序界的”后悔药“。SVN(是subversion的简称)是近年来一款基于C/S架构的......
  • 使用Gitee时,没有.ssh文件
    1.首先在C:\Users里打开自己电脑的管理文件夹2.打开后,右键点击Gitbash,输入以下命令行mkdir~/.ssh//回车ssh-keygen-trsa-C"邮箱"//回车,即可在生成的。ssh文件中找......
  • 【git】git配置两个gitlab和gitee账号和邮箱
    转自:https://www.jianshu.com/p/2192e64a8e36  背景由于公司使用gitlab部署私有代码库,个人有需求使用gitee的开源代码,如果配置全局的账号密码会冲突。所以有必要......
  • Git命令 reset 和 revert 的区别
    前言在团队开发中,使用Git作为版本开发工具,可以便捷地协同多人管理并行开发,但是由于自己或者其他人代码提交污染了远程分支,就需要对远程代码进行恢复操作,Git提供了res......
  • 10、Git命令进行打包
    Git 基本操作、常用命令、代码打包及代码发布https://blog.csdn.net/qq_38487524/article/details/80305202 参考:Git打包文件:https://www.jianshu.com/p/1c2ddcb9d0......