まずはレポジトリのcloneをとり、gitディレクトリに移動。
$ git clone *****@********:***********/test.git Cloning into test... Enter passphrase for key '/home/****/.ssh/id_rsa': remote: Counting objects: 1846, done. remote: Compressing objects: 100% (326/326), done. remote: Total 1846 (delta 1423), reused 1670 (delta 1323) Receiving objects: 100% (1846/1846), 1.64 MiB, done. Resolving deltas: 100% (1423/1423), done. $ cd test/
適当に編集をしてcommitすると、メールアドレスと名前が勝手に設定される。
$ echo "" >> README
$ git commit -a -m "test commit"
[master *******] test commit
Committer: **** <****@**********************>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
If the identity used for this commit is wrong, you can fix it with:
git commit --amend --author='Your Name <you@example.com>'
1 files changed, 1 insertions(+), 0 deletions(-)
メールアドレスと名前をそれぞれのgitレポジトリで明示的に設定するには、gitレポジトリ(.gitのあるディレクトリで)で以下のコマンドを入力する。
$ git config user.email "i38w7i3@yahoo.co.jp" $ git config user.name "AYANOKOUZI, Ryuunosuke"
git configに--globalオプションを付けることでこの設定を全てのレポジトリで共有することが出来る。ただし、レポジトリに対して明示的に設定された設定はこれをオーバーライドする。