LoginSignup
12
9

More than 5 years have passed since last update.

別のブランチとの分岐点を起点に rebase -i する git エイリアス

Last updated at Posted at 2014-06-10

Pull request を送る前にブランチを整理するとき、「master から枝分かれしたコミットから HEAD までのコミット」を git rebase --interactive の対象にしたいことがある。あるのでエイリアスを書いた:

.gitconfig
[alias]
rebase-from-mb = !sh -c 'git rebase -i $(git merge-base ${1:-master} HEAD)' -

git rebase-from-mb <branch> を実行すると、指定したブランチと現在のブランチの分岐点となるコミットから HEAD までを対象に interactive rebase を開始する。 <branch> を省略した場合のデフォルトは master

12
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
9