git push到远程仓库时提示:fatal: The current branch master2 has no upstream branch. To push the current branch and set the remote as upstream,

use git push --set-upstream origin master2,如图:

大意是当前分支与远程分支没有建立关联,提示运行  git push --set-upstream origin master2 与远程仓库建立关联,运行后即可通过 git push 推送成功,如果已在远程github仓库中手动建过同名的本地分支也可通过另一种方法,即:

git push <远程主机名> <本地分支名>:<远程分支名>,两种方法如下:
一、 git push --set-upstream origin master2
二、 git push origin master2:master2

git push时提示"fatal: The current branch master has no..."的更多相关文章

  1. 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:/ ...

  2. git push时提示"Everything up-to-date"

    从github上git clone下的项目,添加或修改文件后,git push时出现"Everything up-to-date" ,   即“一切都是最新的'. 通过 git s ...

  3. git push时提示--set-upstream

    问题: 提示需要加--set-upstream

  4. git:fatal the current branch master has no upstream branch

    git push的时候发生上述错误. git push -u "resp" master resp为git仓库的“地址” reference中由解决方案 http://blog.c ...

  5. git push 时发生错误 error: src refspec master does not match any. error: failed to push some refs to

    很多相关解决办法都是最后要 push 到远端的 master 上,但很多其实要求不能把个人的修改内容直接 push 到 master 主分支. 因此,当我想将本地 feature/work1 分支的修 ...

  6. git push 时提示用户名或密码相关错误信息

    这里讲的是一个常见的第一次push提示输入用户名密码时,输入错误的解决办法.它导致在后面其他项目什么的在push的时候一直失败,并提示有用户名密码错误信息. 第一步:进入到“控制面板” (这里如何进入 ...

  7. Git 2.x 中git push时遇到 push.default 警告的解决方法

    近在学习使用 git&GitHub,然后今天遇到了一个问题.在执行 git add 和 git commit 操作之后,再进行 git push 操作,出现了如下提示: $ git push ...

  8. Git提交时提示‘The file will have its original line endings in your working directory’

    Git提交时提示'The file will have its original line endings in your working directory' Git出现错误 git add -A ...

  9. TortoiseGit做push时提示Disconnected: No supported authentication methods available (server sent: publickey)错误

    通过Git从远程服务器上获得到自己的项目,但是通过TortoiseGit做push时提示Disconnected: No supported authentication methods availa ...

随机推荐

  1. http请求与传参

    这并不算是文章,暂时只做粗略地记录,以免忘记,因此会显得杂乱无章,随便抓了几个包和对postman截图,日后有空再完善 1.get方式 只有一种方式,那就是在url后面跟参数 2.post方式 1)表 ...

  2. node项目中用到的一些模块

    1.http模块,用来搭建服务器 代码,简单服务器实现 var http = require('http'); http.createServer(function (request, respons ...

  3. DOS命令基础,包涵DOS库说明书

    20种常用的DOS命令小结 作者: 字体:[增加 减小] 类型:转载   DOS命令总共大约有一百个(包括文本编辑.查杀病毒.配置文件.批处理等),我们这里详细介绍二十个常用的DOS命令     先介 ...

  4. RESTful API 和 Django REST framework

    100天 cmdb最后一天 #RESTful API - 定义规范 如get就是请求题 - 面向资源编程 把网络任何东西都当作资源 #给一个url,根据方法的不同对资源做不同的操作 #返回结果和状态码 ...

  5. JS Ajax异步请求发送列表数据后面多了[]

    还在苦逼的写代码,这里就不详细了,直接抛出问题: 如图所示: 前端ajax请求向后端发送数据的时候,给key添加了[]出现很多找不到原因, 后面在说 解决方法: 暂时先这样记录一下,下次方便查找,好了 ...

  6. jmock2.5 基本教程

    目录 第0章 概述 第1章 jmock初体验 第2章 期望 第3章 返回值 第4章 参数匹配 第5章 指定方法调用次数 第6章 指定执行序列 第7章 状态机 第0章 概述 现在的dev不是仅仅要写co ...

  7. 一个文件系统过滤驱动的demo

    因为没写过FSD过滤驱动,所以拿来练练手,没有什么技术含量.参考自Win内核安全与驱动开发. 先梳理一下大概的流程,就是怎么去绑定设备栈.怎么去过滤各种请求的. 首先肯定是要绑定设备栈的,来看下怎么绑 ...

  8. **IOS自动完成(搜索自动提示)功能实现

    UISearchBar搜索AutoComplete下拉列表搜索提示 http://www.codeios.com/thread-10685-1-1.html 介绍:     在搜索框上加入下拉列表.在 ...

  9. CentOS 7不能联网解决办法

    在使用 Ubuntu 一段时间之后想体验一下 CentOS,就去下载了 CentOS 7 安装到了虚拟机里面,结果发现不能联网,一直提示Cannot find a valid baseurl for ...

  10. Windows 10利用自带的 Hyper-v 安装Linux

    Linux由于其众多独特的优势(可参见Linux系统的优势),而被很多人所喜爱.而要使用Linux那首先要做的工作就是安装Linux系统了.这里给出在 win10 下利用虚拟机 Hyper-v 安装 ...