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. Delphi : Analyze PE file headers?

    Analyze PE file headers? { You'll need a OpenDialog to open a Exe-File and a Memo to show the file i ...

  2. linux后台开发核心技术

    3. 常用STL的使用 3.1. string (1)string类的实现(使用strlen.strcpy.strcat.strcmp等,注意判NULL). (2)C++字符串和C字符串的转换:dat ...

  3. 网站前端优化技术 BigPipe分块处理技术

    前端优化已经到极致了么?业务还在为看到不停的而揪心么?还在为2秒率不达标苦恼么? 好吧我知道答案,大家一如既往的烦恼中... 那么接下来我们看看,facebook,淘宝,人人网,一淘都是怎么做前端优化 ...

  4. Revit API根据参数类型取得参数的值

    参数的类型string与int取得的方法有所不同,可以封装成一个函数. //得到参数的值 public static string GetParamVal(Document doc, Paramete ...

  5. 在Visual Studio中使用层关系图描述系统架构、技术栈

    当需要描述项目的架构或技术栈的时候,可以考虑使用层关系图. 在解决方案下添加一个名称为"TailspinToys.DesignModel"的建模项目. 在新建的建模项目下添加一个名 ...

  6. 【JVM】linux上tomcat中部署的web服务,时好时坏,莫名其妙宕机,报错:There is insufficient memory for the Java Runtime Environment to continue.

    =========================================================================================== 环境: linu ...

  7. xheditor-文件上传-java-支持html5-application/octet-stream

    package reyo.sdk.utils.file; import java.io.BufferedOutputStream; import java.io.File; import java.i ...

  8. 对Java通配符的个人理解(以集合为例)

    对Java通配符的个人理解(以集合为例) 前言:最近在学习Java,当学到了泛型的通配符时,不是很理解PECS(Producer Extends Consumer Super)原则,以及<? e ...

  9. 7z文件格式及其源码linux/windows编译

    7z文件格式及其源码的分析(二) 一. 准备工作: 1. 源码下载: 可以从官方中文主页下载:http://sparanoid.com/lab/7z/. 为了方便, 这里直接给出下载链接: http: ...

  10. SVG渲染顺序及z轴显示问题(zIndex)

    SVG是严格按照定义元素的顺序来渲染的,这个与HTML靠z-index值来控制分层不一样. 在SVG中,写在前面的元素先被渲染,写在后面的元素后被渲染.后渲染的元素会覆盖前面的元素,虽然有时候受透明度 ...