今天提交git仓库的时候,遇到了如截图所示的问题,提示Your branch is up-to-date with 'origin/master'.

查了些资料后,发现其根本原因是版本分支的问题

这时候我们就需要新建一个分支
$ git branch newbranch
然后检查分支是否创建成功
$ git branch

会有如下提示(前面的*代表的是当前你所在的工作分支)

然后切换到你的新分支
$ git checkout newbranch

如果不放心,还可以 $ git branch确认下

然后将你的改动提交到新分支上
$ git add .
$ git commit -m "18.03.01"
然后git status检查是否成功
然后切换到主分支
$ git checkout master
然后将新分支提交的改动合并到主分支上
$ git merge newbranch
然后就可以push代码了
$ git push -u origin master
最后还可以删除这个分支
$ git branch -D newbranch

END

小礼物走一走,来简书关注我

作者:李佳明先生
链接:https://www.jianshu.com/p/e25c763b9816
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

it commit提示Your branch is up-to-date with 'origin/master'.的更多相关文章

  1. Git代码提交报错 (Your branch is up to date with 'origin/master)

    一.前言 今天码云上提交自己本地的一个SpringBoot+Vue的小项目,由于前端代码提交第一次时候提交码云上文件夹下为空,于是自己将本地代码复制到码云拉取下来代码文件夹下,然而git add . ...

  2. Git报错:Your branch is up to date with 'origin/master'.

    Git在提交的时候报错 Your branch is up to date with 'origin/master'. 报错 Your branch is up to date with 'origi ...

  3. git 拉取远程分支报错(fatal: '' is not a commit and a branch '' cannot be created from it)

    问题描述从远程git上拉取某一个分支,然后报错,拉取不了这个分支. 拉取分支的命令: git checkout -b xxx-static-19 origin/xxx-static-19 其中xxx- ...

  4. Git报错:Your branch is ahead of 'origin/master' by 1 commit

    .    commit之后,用git status,打印信息为: # On branch master # Your branch is ahead of 'origin/master' by 1 c ...

  5. git pull 然后 ahead of origin/master * commit 消失

    本来显示 your branch is ahead origin/master * commit后来也许在master merge 这个分支后, 然后git pull, 就显示Your branch ...

  6. git status message - Your branch is ahead of origin/master by X commits

    git reset --hard origin/master git status FAQ: When I issue the "git status" command, I se ...

  7. 新建本地仓库,同步远程仓场景,出现git branch --set-upstream-to=origin/master master 解决方法

    1.本地创建一个本地仓库 2.关联远程端:git remote add origin git@github.com:用户名/远程库名.git3.同步远程仓库到本地git pull这个时候会报错If y ...

  8. 【IDEA】 Can't Update No tracked branch configured for branch master or the branch doesn't exist. To make your branch track a remote branch call, for example, git branch --set-upstream-to origin/master

    IDEA点击GIT更新按钮时,报错如下: Can't UpdateNo tracked branch configured for branch master or the branch doesn' ...

  9. git: Your branch and 'origin/master' have diverged

    git: Your branch and 'origin/master' have diverged - how to throw away local commits? - Stack Overfl ...

随机推荐

  1. rust控制流

    fn main() { let number = 6; if number % 4 == 0 { println!("number is divisible by 4"); } e ...

  2. 刷题记录:[CISCN2019 总决赛 Day1 Web4]Laravel1

    目录 刷题记录:[CISCN2019 总决赛 Day1 Web4]Laravel1 解题过程 刷题记录:[CISCN2019 总决赛 Day1 Web4]Laravel1 题目复现链接:https:/ ...

  3. 2015-2016-2《Java程序设计》团队博客2

     简易画图板介绍 一.功能结构图 二.主类设计 1.总体设计:在设计简易画图板时,根据程序功能的分类,包含了十二个文件,包括SimpleDraw.java,MenuContainer.java,Dra ...

  4. 利用C++ STL的vector模拟邻接表的代码

    关于vector的介绍请看 https://www.cnblogs.com/zsq1993/p/5929806.html https://zh.cppreference.com/w/cpp/conta ...

  5. 010 @ControllerAdvice

    一:说明 1.说明 这个注解是用于写一个异常捕获的处理类. 这里介绍全局捕获异常,自定义异常捕获 2.ps 在这里,顺便写一下基础的自定义异常类,以后方便用于业务异常继承 二:全局异常捕获 1.处理类 ...

  6. EF6中的SQL监控

    在MVC或WEBAPI中的监控 System.Action<string> action = (string message) => { Debug.WriteLine(messag ...

  7. CNeo编程语言概述

    C语言诞生于1970年,当时在AT&T实验室由Dennis Ritchie主导开发的.据说当时仅用了一周的时间就做好了C语言编译器,所以尽管C语言从90年正式纳入ISO标准委员会,其编号为IS ...

  8. rqalpha学习-2

    conf = default_config()deep_update(user_config(), conf)deep_update(project_config(), conf)   三种不同级别的 ...

  9. 通过自定义EasyNVR的Logo、标题、版权等相关信息构建属于自己的摄像机网页视频直播服务

    随着互联网基础设施建设的发展,4G/5G/NB-IoT各种网络技术.物联网技术的大规模商用,视频随时随地可看.可控.可回溯的诉求越来越多,互联网思维.架构和技术引入进传统监控行业里,成为新形势下全终端 ...

  10. aligin-items与aligin-content的区别

    align-items 属性使用于所有的flex容器,它是用来设置每个flex元素在侧轴上的默认对齐方式 aligin-items 与align-content有相同的功能,不过不同点是它是用来让每一 ...