【Git】Usage of Git Rebase Interactively

About Interactively Rebase

rebase -i or rebase --interactive is a strong command that

eanble drop commit modify commit or adjust commit order

Start Command
git rebase -i <start-commit>

this command will start a vim editor to ask for what you want to change interactively

Decide What to Change

in vim editor, you can input a serial of commands, to decide how to handle every commit after start commit

default editor state is like this, if you not edit it, means nothing will change

pick d34548f Add feature 1
pick 98fb1b9 Add feature 2
pick cbf941f Add feature 3
pick 1499a17 Add feature 4
pick 3e14876 Add feature 5

if you want changed something, you should edit commands above

and then resolve conflicts like normal rebase mode required

that is a collection of repeated work like

git add edit file git rebase --continue edit message

Modify Command

interactive mode supports a large mount of operations

pick means keep commit and change nothing

here is all of the supported command modes

  • pick, keep and no changes
  • drop, remove this commit
  • reword, change message
  • edit, change content and message
  • squash, merge commit into the previous one (ask commit message for merged commit, if not edit, use original by default)
  • fixup, same to squash, but auto use original message
Bless

Lesson is Over, Have A Rest, and Enjoy Your Life .

Good Work, Good Study, Good Progress, and Good Mood !

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值