[Git] Undo my last commit and split it into two separate ones
When you accidentally committed some changes to your branch you have various possibilities to “undo” that operation and add some more changes. One is to use git amend to change the commit message or add new files. But what we want to take out all of the committed changes again and maybe even split them into separate commits. Let’s see how we can achieve that. Note: This only holds if you did not yet push your changes to the remote repository.
In this case, what we can do is first do the reset:
git reset HEAD~
Then spreate files into diifferent commit messages.
[Git] Undo my last commit and split it into two separate ones的更多相关文章
- git cherry-pick合并某个commit
1.使用方法及其作用 git cherry-pick可以选择某一个分支中的一个或几个commit(s)来进行操作(操作的对象是commit).例如,假设我们有个稳定版本的分支,叫v2.0,另外还有个开 ...
- svn迁移到git仓库并保留commit历史记录
svn迁移到git仓库并保留commit历史记录 最近在做svn迁移到gitlab,由于之前一直是由svn做版本控制.最简单的方式是将svn的内容export出来,然后添加到gitlab即可.但是,如 ...
- git 对比两个commit 之间的差异
git 对比两个commit 之间的差异 比较两个版本之间的差异 git diff commit-id-1 commit-id-2 > d:/diff.txt 结果文件diff.txt中: &q ...
- Git合并最近的commit
合并commit的做法一般用在pull request的时候,把开发同一功能时的所有琐碎的commit合并到一个(假装自己的代码是高质量代码(手动滑稽)).主要使用的命令是git rebase 或者g ...
- (转)git合并多个commit
原文地址:http://platinhom.github.io/2016/01/02/git-combine_commit/ 有时commit多了看着会不爽.所以想合并掉一些commit. 这里是最简 ...
- 使用git rebase合并多次commit
使用git rebase合并多次commit 聊下 git rebase -i
- Git missing Change-Id in commit message footer解决方法
Git missing Change-Id in commit message footer解决方法在Git向服务器提交代码时,出现如下错误missing Change-Id in commit me ...
- 『现学现忘』Git对象 — 17、Commit对象
目录 1.Commit对象介绍 2.Commit对象说明 3.本地库中对象之间的关系 4.总结 5.练习 6.本文用到的命令总结 1.Commit对象介绍 现在来介绍最后一种Git对象commit对象 ...
- [Git] Undo a commit that has already been pushed to the remote repository
If we pushed our changes already to the remote repository we have to pay attention to not change the ...
随机推荐
- Serilog简介
Serilog是.net 下的新兴的日志框架,本文这里简单的介绍一下它的用法. 首先安装Nuget包: Install-Package Serilog Install-Package Serilog. ...
- 【Go命令教程】4. go get
hc@ubt:~$ go get github.com/hyper-carrot/go_lib/logging 命令 go get 可以根据要求和实际情况从互联网上下载或更新指定的代码包及其依赖包,并 ...
- C - 项目收藏
Web框架 [荐]Kore:开源 C 语言 Web 框架 Raphters:A web framework for C ulfius:Web Framework for REST API in C, ...
- Unity3d学习笔记记录
1.发布到 ipad字体显示不出来,改变Position位置的Z轴为-1 2.发布打包有问题,记得用户权限有没有设置 3.ipad4分辨率:2048*1536 4.调整界面大小,尽量调整底下子对象位置 ...
- WCF技术我们应该如何以正确的方式去学习掌握
一.WCF技术我该如何学习? 阿笨的回答是:作为初学者的我们,那么请跟着阿笨一起玩WCF吧,阿笨将带领大家如何以正确的姿势去掌握WCF技术.由于WCF技术知识点太多了,就纯基础概念性知识都可以单独出一 ...
- could not load inserted library: /usr/lib/libgmalloc.dylib
本人也刚开始学习iphone开发,最近维护一个程序时,不知道怎么弄的,不能build到真机了,到模拟器没有什么问题,出现的错误是 :---->>>could not load ins ...
- libxml2.dylb 罗致<libxml/tree.h> 老是找不到头文件
libxml2.dylb 导致<libxml/tree.h> 老是找不到头文件 添加了libxml2.dylb的framework ,结果还是引用不了<libxml/tree.h&g ...
- 【jvm】linux 调用 jmap 报错Permission denied
linux 调用 jmap 报错Permission denied 解决方案: 分别对java安装目录,java的bin目录以及jmap命令设置权限 chmod jdk1..0_79 chmod b ...
- Android NDK:Aborting..Stop的处理方法
在eclipse中配置cocos2d-x的android环境时,遇到这样的错误提示 网上搜索了一下,说是在NDK_MODULE_PATH环境变量下未找到所需要的Android.mk文件,后来仔细研究了 ...
- 实用ExtJS教程100例-006:ExtJS中Window的用法示例
在前面几个示例中,我们演示了MessageBox的各种用法,今天这篇文章将演示如何使用Window. 我们首先来创建一个窗口: var win = Ext.create("Ext.windo ...