Git Author
git author ver 2.0.0の日本語ドキュメントです。
リポジトリ
旧バージョン(ver 1.0)のドキュメントはこちら
Overview
- コマンド一発でuser.nameとuser.emailを取得または設定できます
- コマンド一発でuser.nameとuser.emailを削除できます
- 過去のコミットのAuthor/Committerを書き換えることができます
Installation
Cargoが使える必要があります。
$ cargo install git-author
でインストールできます。
Usage
# get
$ git author [config file location]
$ git author get [config file location]
# set
$ git author set [config file location] <name> <email>
# unset
$ git author unset [config file location]
## replace-simple
$ git author replace simple <old-name> <old-email> [new-name] [new-email]
## replace-detail
$ git author replace detail --filter-author <name> <email> --filter-committer <name> <email> --replace-target <replace-target>
Description
get
$ git author [config file location]
$ git author get [config file location]
git authorまたはgit author getでuser.nameとuser.emailを取得できます。

set
$ git author set [config file location] <name> <email>
user.nameとuser.emailを設定できます。

unset
$ git author unset [config file location]
user.nameとuser.emailの設定を削除できます。

replace
過去のコミットのAuthorとCommitterを書き換えます。
サブコマンドとしてsimpleとdetailが存在します。
simple
$ git author replace simple <old-name> <old-email> [new-name] [new-email]
過去のコミットのAuthor/Committerのold-name <old-email>をnew-name <new-email>に置き換えます。
new-nameとnew-emailを省略した場合はgit authorで取得できるnameとemailを使用します。

detail
$ git author replace detail --filter-author <name> <email> --filter-committer <name> <email> --replace-target <replace-target>
指定した条件のコミットのAuthorとCommitterのいずれかまたは両方のnameとemailを置き換えます。
options
フィルタリング条件
-
--filter-author <name> <email>
Authorでフィルタリングする場合に指定する。
--filter-committerが指定されていない場合は必須。 -
--filter-committer <name> <email>
Committerでフィルタリングする場合に指定する。
--filter-authorが指定されていない場合は必須。 -
--filter-type <filter-type>
フィルタリング条件にAuthorとCommitterの両方が一致するか片方が一致するかを指定する。
filter-typeにはandかorを指定可能。デフォルトはand。
--filter-authorと--filter-committerの両方が設定されているときのみ有効。
置き換え後の値
-
--author <name> <email>
置き換え後のAuthor。省略した場合はgit authorで取得できるnameとemailを使用する。
--replace-targetでauthorかauthor-and-committerが指定されたときのみ使用する。 -
--committer <name> <email>
置き換え後のCommitter。省略した場合はgit authorで取得できるnameとemailを使用する。
--replace-targetでcommitterかauthor-and-committerが指定されたときのみ使用する。
置き換え対象
-
--replace-target
置き換え対象を指定する。author: Authorのみcommitter: Committerのみauthor-and-committer: AuthorとCommitter
が指定可能。
