问题:当我执行git push命令的时候,报错如下:

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream

当前分支主服务器没有上游分支,推送当前分支并将远程服务器设置为上游

复现

首先创建远程仓库,然后在本地

git init
git remote add origin https://username@xxx.com/xxx.git
git add .
git remote add origin
git push

然后报错

解决办法

git pull

git push --set-upstream origin master(master可以根据你的需要自定义,就是当前分支在远程分支对应的名称)

Git错误,fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream的更多相关文章

  1. Git:错误:error:src refspec master does not match any

    新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u ...

  2. git 错误 fatal: Not a valid object name: 'master'

    问题场景:新建git项目或刚为已存在项目创建了git仓库,想用git branch dev创建dev分支或用git checkout -b dev创建并切换到dev分支时报错. 原因:刚创建的git仓 ...

  3. git 错误 fatal: loose object...is corrupt

    错误描述: error: object file .git/objects/9a/83e9c5b3d697d12a2e315e1777ceaf27ea1bab is empty fatal: loos ...

  4. git推送代码报错:fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream

    情景再现 远程新建仓库,然后本地 git bash执行以下代码 git init git add . git commit -m 'xxx' git remote add origin https:/ ...

  5. git push时提示"fatal: The current branch master has no..."

    git push到远程仓库时提示:fatal: The current branch master2 has no upstream branch. To push the current branc ...

  6. Git hub pull时候的错误 : The current branch is not configured for pull No value for key branch.master.merge found in configuration

    网上多半都是命令行下的解决方案,我用的是EGit,所以要在eclipse里(我的版本是kepler)把下面这句话添加到配置文件中. Window->Preference->Team-> ...

  7. eclipse git 一个错误:the current branch is not configured for pull No value for key branch.xxx.merge found

    eclipse git 一个错误:the current branch is not configured for pull No value for key branch.xxx.merge fou ...

  8. 解决Git报错:The current branch is not configured for pull No value for key branch.master.merge found in configuration

    1.在本地工程目录找到config文件(我的是在D:\git\demo\.git):2.修改config文件内容为: [core] repositoryformatversion = 0 filemo ...

  9. git:解决The current branch is not configured for pull No value for key branch.master.merge found in config

    网上多半都是命令行下的解决方案,我用的是EGit,所以要在eclipse里(我的版本是kepler)把下面这句话添加到配置文件中. Window->Preference->Team-> ...

  10. 解决The current branch is not configured for pull No value for key branch.master.merge found in config

    使用Git Pull项目的时候出现这个问题: The current branch is not configured for pull No value for key branch.master. ...

随机推荐

  1. 独“数”一帜 双证加冕!TeleDB亮相可信数据库发展大会

    近日,2024可信数据库发展大会在北京召开,主题为"自主.创新.引领".大会重磅发布多项中国信通院及中国通信标准化协会大数据技术标准推进委员会(CCSA TC601)在数据库领域最 ...

  2. Luogu P9870 NOIp2023 双序列拓展 题解 [ 紫 ] [ 动态规划 ] [ 分治 ] [ adhoc ]

    双序列拓展:很妙的特殊性质类 dp 题,由部分分引导向正解. 题意简化 你可以把序列 \(X\) 和序列 \(Y\) 中的每一个数复制若干倍并接到这个数后面,问能否构造出一种方案,使得两个序列长度相等 ...

  3. kubsphere应用系列(三)-创建手动流水线

    准备工作 1.1 创建凭证 1.2 添加代码仓库 第一步创建流水线   第二步配置流水线 1.1选择CI/CD模板 1.2删除多余阶段 1.3 配置git仓库信息     1.4配置docker仓库信 ...

  4. 用于敏捷开发的最佳免费 UML 工具 2022

    Table of Contents  hide  1 最好的在线免费 UML图工具 2 免费的 UML Visual Paradigm 在线平台 3 其他福利 4 用于正式和大规模可视化建模的 Vis ...

  5. Java进阶 - [1-4] 反射

    一.类加载区别 当我们刚接触java语言的时候,我们最常见的代码应该就是初始化某个对象,然后调用该对象的方法. 1.使用new创建对象,返回对象的引用.Student student = new St ...

  6. 【FAQ】HarmonyOS SDK 闭源开放能力 —Map Kit(5)

    1.问题描述: 提供两套标准方案,可根据体验需求选择: 1.地图Picker(地点详情) 用户体验:①展示地图 ②标记地点 ③用户选择已安装地图应用 接入文档:https://developer.hu ...

  7. 【P3】Logisim搭建单周期MIPS-CPU

    最近在想,我究竟能从计组课程中学到什么.依葫芦画瓢地搭一个CPU不难,但稍微设想一下从无到有设计指令,构建数据通路控制器,再到优化为多周期.流水线,在权衡中各模块互相调节...整个过程复杂困难曲折到令 ...

  8. Vulnhub-Source-1(CVE-2019-15107)

    一.靶机搭建 选择打开选项 选中下载的ova文件,然后导入选择一个存放路径即可 如果遇到不兼容的情况,可以打开.vmx修改,改为和虚拟机一个版本号 二.信息收集 官方信息 Name: Source: ...

  9. 基于webman实现的服务层框架-webman-biz-framework

    简介 webman的基础上扩展的一个服务层框架,基于分层体系结构的代码模式. 如果觉得有用,可以帮我在webman-biz-framework点个小星星哟,也希望大家交流 分层体系结构的代码模式 什么 ...

  10. Qt 重载QComboBox,实现右侧删除键

    文章目录 Qt 重载QComboBox,实现右侧删除键 前言 方案 设置下拉箭头图标 设置QComboBox内容为空 自定义showPopup函数 定位鼠标 屏蔽鼠标右键 最终控制下拉代码 效果图 代 ...