Gosh no, I just added all of these commits to master. They were thought to be peer reviewed first in a dedicated branch! No worries, in this lesson we’re going to see a couple of commands that will help you move your commits into a dedicated feature branch.

Note: This only holds if you did not yet push your changes to the remote repository

For example, latest commits should goes to feature branch not the master branch.

First checkout a new branch. So that we can keep all the changes we made.

Then back to master branch

What should we do is reset the head to '9a7f06b':

git reset --hard 9a7f06b

[Git] Move some commits to a separate branch that I have accidentally committed to master的更多相关文章

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

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

  2. Git合并特定commits 到另一个分支

    https://ariejan.net/2010/06/10/cherry-picking-specific-commits-from-another-branch/ http://blog.csdn ...

  3. Git 解决同步 No value for key branch.master.merge found in

    [core] repositoryformatversion = 0 filemode = false logallrefupdates = true [remote "origin&quo ...

  4. 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 ...

  5. [Practical Git] Clean up commits with git rebase

    Sometimes its nice to clean up commits before merging them into your main code repo; in this lesson, ...

  6. Git的一些用法(建立新的branch)

    建立新的branch和查看全部的branch(kk的代码是基于现有的branch) 切换到branch kk: 当然我们也能够在android studio里操作: 注意切换的时候代码会丢失,必须先c ...

  7. 【Git】(2)---checkout、branch、log、diff、.gitignore

    常用命令 一.命令 1.checkout 切换分支 git checkout 分支名 #切换分支 #如果在当前分支上对文件进行修改之后,没有commit就切换到另外一个分支b, 这个时候会报错,因为没 ...

  8. git pull时解决分支分叉(branch diverged)问题

    git pull时出现分支冲突(branch diverged) $ git status # On branch feature/worker-interface # Your branch and ...

  9. 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 ...

随机推荐

  1. Technical Information ARM-related JTAG / SWD / SWV / ETM Target Interfaces

    https://www.computex.co.jp/eg/products/pdf/technical_pdf/arm_if01_gijutsu_eng.pdf

  2. discuz修改太阳,月亮,星星等级图标

    想必大家都想修改一下默认的等级图标吧,刚才在论坛上看见很多大神的方法都是要修改文件的,不过为了安全起见需要事先备份好才改,这种方法是可行的,但可能有些新手站长不会修改,又或者改错了恢复不来,现在我教大 ...

  3. Tomcat 负载均衡 及Session共享

    原文:https://www.sunjianhua.cn/archives/tomcat-high-availability.html 一.安装java环境 二.安装tomcat(apache-tom ...

  4. ios(包括6、7)应用程序引用系统通讯录的方法 [亲测可行]

    由于ios系统对用户隐私的控制,第三方应用程序只能通过苹果官方接口调用系统通讯录,不能像android那样直接操作通讯录数据库.     一般地,使用系统自带通讯录的方法有两种,一种是直接将整个通讯录 ...

  5. C#编程(三十八)----------运算符

    原文链接: http://blog.csdn.net/shanyongxu/article/details/46877353 运算符 类别 运算符 算术运算符 + - * / 逻辑运算符 &  ...

  6. excel System.Runtime.InteropServices.COMException (0x80010105): 服务器出现意外情况。 (异常来自 HRESULT:0x80010105 (RPC_E

    System.Runtime.InteropServices.COMException (0x80010105): 服务器出现意外情况. (异常来自 HRESULT:0x80010105 (RPC_E ...

  7. RabbitMQ:基本命令

    rabbitmq的安装.启动和停止 rabbitmq-service.bat install rabbitmq-service.bat start rabbitmq-service.bat stop ...

  8. BootStrap中的button使用

    原文地址:http://www.phloxblog.in/bootstrap-buttons/#.U5xYso2fclm 站点中事件的触发往往依赖于button或者超链接.因此,button能够觉得是 ...

  9. WebRTC 基于GCC的拥塞控制(上)

    转自:http://blog.csdn.net/doitsjz/article/details/56481981 实时流媒体应用的最大特点是实时性,而延迟是实时性的最大敌人.从媒体收发端来讲,媒体数据 ...

  10. .Net Standard 类库的创建和使用

    一..Net Standard类库的创建 1.在当前Vs 2017中创建.Net Standard 类库项目,目前版本默认值 .Net Standard v1.4 二..Net Standard类库的 ...