【Android Studio】Rebase Current onto Selected

 

目录

 

1. 问题

2. 解释

3. 举例


 

1. 问题

最近在更新Android Studio 中,不知道啥时候出来个'Rebase Current onto Selected' 选项 ?

如下图所示:

那具体是啥含义,怎么用呢 ?

1. 刚开始我猜的大致含义,把当前所在分支(current_0),参考 已选择的分支(base) 变基,进行重建操作;      // 感觉有点默认两可,似对非对的样子

 

扫描二维码关注公众号,回复: 9826970 查看本文章

2. 解释

打开 Version Control 视图下的 Console 视图,发现有 git ...  rebase ... 之类的;

然后查找资料:

$ git rebase --onto base from to // 命令的具体含义是使用(from, to]所指定的范围内的所有commit在base这个commit之上进行重建.

比葫芦画瓢照着来,

$ git rebase --onto base_0 mock current_0
First, rewinding head to replay your work on top of it...
Applying: mock_current

3. 举例

1. 拿实际例子说明一下,

首先新建master_base 分支,然后为了简便说明问题,新建dev 分支,mock 分支,mock_current 分支,current_0 分支,如下图所示:

当前我在 current_0 分支上, 然后我执行如下命令:

$ git rebase --onto base_0 mock current_0
First, rewinding head to replay your work on top of it...
Applying: mock_current

变成如下所示:

一看确实是current_0 分支上(mock,current_0]base_0 上这个commit 节点变基,然后在current_0 分支上进行了重建操作;

(完).

发布了66 篇原创文章 · 获赞 17 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/DovSnier/article/details/103065376