47
48

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.

世界三大覚えてられないけど有用な知識 [1] first commitを改竄するには git rebase -i --root

Last updated at Posted at 2014-10-29

git init 直後のコミットは git rebase -i HEAD@{1} ではrebaseできない。
user.nameuser.email を設定し忘れて first commit しちゃったときに困ったりする。

そんなときは

% git rebase -i --root

各commitをeditし、 git commit --amend する。

commitのauthorを変えるには

% git commit --amend --author="YOUR NAME <your_name@example.com>"

歴史を書き換えるのでリモートにはforce pushが必要。

参考

47
48
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
47
48

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?