smartgit document Rebase
The Rebase command allows you to apply commits from one branch to another. Rebase can be viewed as more powerful version of Cherry-Pick, which is optimized to apply multiple commits from one branch to another. In SmartGit, a distinction is made between Rebase HEAD to and Rebase to HEAD:
Rebase HEAD to rebases ("moves") the commits below the HEAD to the selected commit. The HEAD will be moved to the new fork.
o [> master] A o [> master] A' | | o B o B' | | o C o C' | | | o [a-branch] D | o [a-branch] D | | | / | | | / | o E (selected) ===> o E | / | | / | o F o F |
Rebase to HEAD duplicates commits from a separate branch to the HEAD (similar to what Cherry-Pick does). The HEAD moves forward on its fork.
o [> master] B' | o C' | o D' | o [> master] A o A | | | o [a-branch] | o [a-branch] | | | | | o B (selected) | o B | | | | | o C ==> | o C | | | | | o D | o D | / | / | / | / o E o E |
To Rebase Onto you may use the Log window. Consider following example where the quickfix2
branch should not start at the quickfix1
branch, but rather on the master
branch:
q2b (quickfix2) | q2a | q1b (quickfix1) | q1a | x (master) | ... |
To achieve this, just drag the q2a
commit onto the x (master)
commit and you will get the desired result:
q2b (quickfix2) | q2a | | q1b (quickfix1) | | | q1b | / x (master) | ... |
In SmartGit, there are several places from which you can initiate a rebase:
- Menu and toolbar On the main window, select Branch|Rebase HEAD to or Branch|Rebase to HEAD to open the Rebase dialog, where you can select the branch to rebase the HEAD onto, or the branch to rebase onto the HEAD, respectively. Depending on your toolbar settings, you can also open this dialog via the buttons Rebase HEAD to and Rebase to HEAD on the toolbar.
- Branches view In the Branches view, you can right-click on a branch and select Rebase HEAD to to rebase your current HEAD onto the selected branch.
- Log Graph On the Log graph of the Log window, you can perform a rebase by right-clicking on a commit and selecting Rebase HEAD to or Rebase to HEAD from the context-menu.
- Log Graph In the Log graph of the Log window, you can drag and drop commits or refs and then select to rebase in the occurring dialog after the drop.
Just like a merge, a rebase may fail due to merge conflicts. If that happens, SmartGit will leave the working tree in rebasing state, allowing you to either manually resolve the conflicts or to Abort the rebase. See Resolving Conflicts for further information.
Resolving Conflicts
Core Git rebase conflicts are different to other kinds of merge conflicts, because left and right files are swapped: when rebasing branch A
to B
, Git will first checkout B
, then applies all commits from A
. If a conflict occurs, HEAD
still points to B
and hence the left file would be the file as it's present in B
.
From a user's perspective, the left file should always be his/her own file ("ours"), i.e. the file as it's present in A
. For this reason, in case of rebase conflicts, SmartGit will swap left and right files. This gives a more consistent user experience, however may result in following different behavior (compared to normal merge conflicts):
- When staging left lines (Ours) in the Conflict Solver, these lines will finally show up as staged, because your rebase branch
B
is actually "theirs" - When invoking Resolve and selecting Ours, you will see staged file content, because your rebase branch
B
is actually "theirs"
smartgit document Rebase的更多相关文章
- smartgit document merge
'Normal' Merge In case of a normal merge, a merge commit with at least two parent commits (i.e., the ...
- SmartGit STUDY 2
The Index The Index is an intermediate cache for preparing a commit. With SmartGit, you can make hea ...
- SmartGit as SVN Bridge
This page provides an introduction to SmartGit from an SVN users perspective and shows how the SVN w ...
- SmartGit STUDY
Git Concepts This section helps you to get started with Git and gives you an understanding of the fu ...
- document.documentElement.clientHeight 与 document.body.clientHeight(杜绝千篇一律的抄袭!!)
document.documentElement.clientHeight 与 document.body.clientHeight用来获取页面可视高度我觉得有点问题.这两个应该不是一个东西. 页面中 ...
- jquery中的$(document).ready(function() {});
当文档载入时执行function函数里的代码, 这部分代码主要声明,页面加载后 "监听事件" 的方法.例如: $(document).ready( $("a") ...
- document.compatMode
在我电脑屏幕上显示的 电脑是 1920*1080这是在document.compatMode:css1Compat模式 window.screen.availWidth 1920 window.scr ...
- 谈谈document.ready和window.onload的区别
在Jquery里面,我们可以看到两种写法:$(function(){}) 和$(document).ready(function(){}) 这两个方法的效果都是一样的,都是在dom文档树加载完之后执行 ...
- Git 进阶指南(git ssh keys / reset / rebase / alias / tag / submodule )
在掌握了基础的 Git 使用 之后,可能会遇到一些常见的问题.以下是猫哥筛选总结的部分常见问题,分享给各位朋友,掌握了这些问题的中的要点之后,git 进阶也就完成了,它包含以下部分: 如何修改 ori ...
随机推荐
- html5的改进与沿革
HTML5提供了一些新的元素和属性,例如<nav>(网站导航块)和<footer>.这种标签将有利于搜索引擎的索引整理,同时更好的帮助小屏幕装置和视障人士使用,除此之外,还为其 ...
- MySQL日志功能
1.查询日志 log={ON|OFF}:是否记录所有语句的日志信息于一般查询日志文件(general_log); log_output={TABLE|FILE|NONE},TABLE和FILE可以同时 ...
- java的nio之:java的nio系列教程之SocketChannel
Java NIO中的SocketChannel是一个连接到TCP网络套接字的通道.可以通过以下2种方式创建SocketChannel: 打开一个SocketChannel并连接到互联网上的某台服务器. ...
- c++特性:指向类成员的指针和非类型类模板参数和函数指针返回值 参数推导机制和关联型别
一.c++允许定义指向类成员的指针,包括类函数成员指针和类数据成员指针 格式如下: class A { public: void func(){printf("This is a funct ...
- combobox select .change onSelect事件触发
我现在要完成的功能是:有两个下拉框,当地一个下拉框选择了第一个选项时,第二个下拉框不可用,否则就可用. 用了jQuery easyUI提供的onSelect方法.如下:js文件:$('#select1 ...
- 项目发布: error CS0103: 当前上下文中不存在名称“*****”
项目发布,发布不出来,而且编译,发布过程中vs也不报错,也不提示错误. 在错误窗口忽闪一个错误提示之后,输出窗口有西边的提示: error CS0103: 当前上下文中不存在名称"Cur ...
- 08-Java 多线程编程
1.Java多线程-线程与进程的区别 (1)线程:程序中单独依靠程序进行运行 线程是程序中的顺序控制流,只能使用分配给程序的资源和环境. (2)进程:执行中的程序 一个进程可以包含一个或多个线程. 一 ...
- max plugin wizard,project creation faild解法
两点需要注意: 1,要将maxsdk的3dsmaxPluginWizard文件夹设为只读. 2,要将3dsmaxPluginWizard.vsz中的"Wizard="设置为正确的v ...
- ASP.NET Cookie 概述【转】
来源:http://msdn.microsoft.com/zh-cn/library/ms178194(VS.80).aspx ASP.NET Cookie 概述 Cookie 提供了一种在 Web ...
- wikioi 1973 Fibonacci数列【输出第N项的值】
/*===================================== 1978 Fibonacci数列 3 题目描述 Description 斐波纳契数列是这样的数列: f1 = 1 f2 ...