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. K/V式枚举

    public enum OType { LOGIN { public String getDesc() { return "登录"; } }, ADD { public Strin ...

  2. php中heredoc的使用方法

    Heredoc技术,在正规的PHP文档中和技术书籍中一般没有详细讲述,只是提到了这是一种Perl风格的字符串输出技术.但是现在的一些论坛程序,和部分文章系统,都巧妙的使用heredoc技术,来部分的实 ...

  3. dragstart drag dragend dragenter dragover dragleave drop

    dragstart drag dragend dragenter dragover dragleave drop   前端框架层出不穷,网页上的效果越来越绚丽,制作绚丽的效果的成本越来越低,其中有种拖 ...

  4. window.onload绑定多个事件 —— 两种解决方案

    前言 有些函数,必须在网页加载完毕后执行.比如:涉及DOM操作的. 网页加载完毕时会触发一个onload事件,将函数绑定到这个事件上即可. window.onload = myFunction; 问题 ...

  5. Spring框架(管理事务)

    Spring底层使用Transaction事物模板来进行操作.具体操作: 1.service 需要获得 TransactionTemplate 2.spring 配置模板,并注入给service 3. ...

  6. TCP连接建立与断开

    tcp状态 LISTEN:侦听来自远方的TCP端口的连接请求 LISTEN:侦听来自远方的TCP端口的连接请求 SYN-SENT:再发送连接请求后等待匹配的连接请求 SYN-RECEIVED:再收到和 ...

  7. LeetCode691. Stickers to Spell Word

    We are given N different types of stickers. Each sticker has a lowercase English word on it. You wou ...

  8. python 统计MySQL表信息

    一.场景描述 线上有一台MySQL服务器,里面有几十个数据库,每个库有N多表. 现在需要将每个表的信息,统计到excel中,格式如下: 库名 表名 表说明 建表语句 db1 users 用户表 CRE ...

  9. Python 安装 pytesser 处理验证码出现的问题

    今天这个问题困扰了我好久,开始直接用 pip install pytesseract 安装了 pytesseract 然后出现了如下错误 Traceback (most recent call las ...

  10. ef查询mysql数据库数据支持DbFunctions函数

    1.缘由 快下班的时候,一同事说在写linq查询语句时where条件中写两时间相减大于某具体天数报错:后来仔细一问,经抽象简化,可以总结为下面的公式: a.当前时间 减去 某表时间字段 大于 某具体天 ...