4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

git rebase -i "HEAD~N"を打ちやすくする

Posted at

今のブランチの頭から、N個のコミットを圧縮したり改変したり、ということを多様するので、
zshで簡単に打てるように関数化した。

function grbi() {
  if [ "$1" -gt 0 ]; then
    git rebase -i "HEAD~${1}"
  else
    echo "Using: grbi n\n  (n is number greater then 0)"
  fi
}

grbi 3で現在のブランチの最新コミットから3つ過去までのコミットを改変する。

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?