问题:当我执行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. 巧用 CSS 实现高频出现的复杂怪状按钮 - 镂空的内凹圆角边框

    在之前,我们有些过这么一篇文章 - 使用 CSS 轻松实现高频出现的各类奇形怪状按钮. 里面包含了如下这些图形: 你可以在这里看到:CodePen Demo -- CSS Various Button ...

  2. 数字先锋 | 车企,出海!天翼云AOne擦亮车企“智慧服务”新名片!

    近年来,中国汽车市场迎来巨变,消费者的消费习惯不断变迁,价格战愈演愈烈......如何紧跟数字化转型步伐,实现稳健经营,成为车企所面临的时代命题. 作为一家科技型制造企业,某车企主营业务涉及汽车及核心 ...

  3. 玩转云端 | 天翼云边缘安全加速平台AccessOne实用窍门之多款产品管理难?一站式平台管理全hold住!

    随着数字化转型深入推进,企业信息化建设成效显著,同时其所面临的安全与性能挑战也日趋复杂,既要确保业务系统的安全性,同时也要提供快速.流畅的用户体验,以提升用户满意度和业务竞争力. 在传统的解决方案中, ...

  4. Idea无法下载插件或下载插件报错

    Plugin Python was not installed: Cannot download 'https://plugins.jetbrains. file ->  settings -& ...

  5. Hetao P3804 Cut 题解 [ 蓝 ] [ AC 自动机 ] [ 差分 ]

    Cut:AC 自动机简单题. 思路 看见多个模式串以及求前缀,很显然能想到构建一个 AC 自动机. 那么在用 \(T\) 查询时,当前指针的深度就是该位置的最长前缀匹配长度.这个在字典树 insert ...

  6. Luogu P10842 Piggy and Trees 题解 [ 绿 ] [ 拆边 ] [ 贡献思维 ] [ 组合数学 ]

    Piggy and Trees:把路径拆成边的思维题. 思路 一看到这题的路径,就想到了 Luogu P3177 树上染色 这题化路径为边的贡献,分别计算的思维. 那么对于此题,先来观察题目里式子的意 ...

  7. vivo HTTPDNS 端到端体验优化实践

    作者:来自 vivo 互联网运维团队- Zhang Qianqian 在信息时代,用户的手机应用访问量日益增多,DNS 解析作为连接互联网的关键环节,也被提出了更高要求.这一背景下,HTTPDNS 域 ...

  8. LINUX 服务器安装nginx redis jdk等步聚

    1.安装指令步聚 sudo yum update 更新linux系统 yum install -y nginx 安装nginx systemctl enable nginx 设置开机启动nginx s ...

  9. cgroup与systemd: 通过src rpm获取systemd源代码,添加日志并使用rpmbuild重新打包

    问题起源 服务跑在富容器中.容器使用init进程作为一号进程,然后用systemd管理所有service. 在做一次升级时,nginx启动脚本有更新,原来是root拉起,现在进行了去root改造,使用 ...

  10. Flink学习(一) 行情介绍

    想进大厂,必须掌握 Flink 技术!!! 随着大数据时代的发展.海量数据的实时处理和多样业务的数据计算需求激增,传统的批处理方式和早期的流式处理框架也有自身的局限性,难以在延迟性.吞吐量.容错能力, ...