[Git] Move some commits to a separate branch that I have accidentally committed to master
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的更多相关文章
- Git代码提交报错 (Your branch is up to date with 'origin/master)
一.前言 今天码云上提交自己本地的一个SpringBoot+Vue的小项目,由于前端代码提交第一次时候提交码云上文件夹下为空,于是自己将本地代码复制到码云拉取下来代码文件夹下,然而git add . ...
- Git合并特定commits 到另一个分支
https://ariejan.net/2010/06/10/cherry-picking-specific-commits-from-another-branch/ http://blog.csdn ...
- Git 解决同步 No value for key branch.master.merge found in
[core] repositoryformatversion = 0 filemode = false logallrefupdates = true [remote "origin&quo ...
- 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 ...
- [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, ...
- Git的一些用法(建立新的branch)
建立新的branch和查看全部的branch(kk的代码是基于现有的branch) 切换到branch kk: 当然我们也能够在android studio里操作: 注意切换的时候代码会丢失,必须先c ...
- 【Git】(2)---checkout、branch、log、diff、.gitignore
常用命令 一.命令 1.checkout 切换分支 git checkout 分支名 #切换分支 #如果在当前分支上对文件进行修改之后,没有commit就切换到另外一个分支b, 这个时候会报错,因为没 ...
- git pull时解决分支分叉(branch diverged)问题
git pull时出现分支冲突(branch diverged) $ git status # On branch feature/worker-interface # Your branch and ...
- 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 ...
随机推荐
- WICED SDK 3.3.1
7/20/2015 UPDATE: After installing the IDE you may not see all the APPs. Press F5 in Eclipse to ref ...
- 理解 process.initgroups(user, extra_group)
这个函数是对 linux C函数 initgroups() 的包装 node.js 官方文档非常含糊,还是看 linux C函数文档的解释!非常清楚明确. The initgroups() fun ...
- SRM 449 DIV 1 总结(550p标记下,下次做)
今天的250p搞得有点久了,500p是个类似铺瓷砖的dp题,这样先占个坑,给个poj的这类题列表,下次刷完了回来做! POJ 相关DP列表 http://blog.csdn.net/jayye1994 ...
- PeekMessage和GetMessage函数的主要区别
PeekMessage和GetMessage函数的主要区别 PeekMessage和GetMessage函数的主要区别有:1. GetMessage的主要功能是从消息队列中“取出”消息,消息被取出以后 ...
- 淡淡理解下AngularJS中的module
在AngularJS中module是一个核心的存在,包括了很多方面,比如controller, config, service, factory, directive, constant, 等等. 在 ...
- 在AngularJS中使用ES6
本篇记录一些AngularJS结合使用ES6的各种写法. ES6中module的导出导入 class MainController { constructor(searchService){ this ...
- SQLCE使用本地数据库优化
一.数据绑定 1.使用数据虚拟化和SKIP/TAKE 使用 Skip 和 Take 方法可确保直到需要在 ListBox 控件中显示数据时才将数据库中的数据加载到内存中. 例如,以下代码显示了如何从数 ...
- 【Gitlab】从Gitlab拉取项目+往Gitlab发布项目 【GitLab自定义端口】
1>GIt需要提前安装在本地,本机,自己的电脑,开发环境电脑,IDEA所在的电脑 2>代码仓库:gitlab 3>开发工具:IDEA 4>内网搭建gitlab,访问url: h ...
- cocos2d-x 真正的定时器之schedule
转载请注明,原文地址:http://blog.csdn.net/musicvs/article/details/8551066 正文: 1. 不调用update函数,调用自己的函数 其实原理是一样的, ...
- Netty 包头
LengthFieldBasedFrameDecoder 常用的处理大数据分包传输问题的解决类,先对构造方法LengthFieldBasedFrameDecoder中的参数做以下解释说明 maxFra ...