LoginSignup
3
1

More than 5 years have passed since last update.

Gitでの名前を使いわけたい人向けメモ

Posted at

会社でのアカウントと個人でのアカウントなど、GitHubやBitbucketにおいて複数アカウントを持っているケースはあると思います。いや、あるんです(言い切る)。

でも誤って個人の名前で会社のリポジトリにプッシュとかしたときには…。
そんな方向けのメモ。何番煎じだよって感じだが。

マシン共通の設定 (global)

これは ~/.gitconfig に保存されるので、デフォルトになるって感じ。

git config --global user.name "KirimaSharo"
git config --global user.email "sharokirima@pfcolle.com"

各ディレクトリでの設定

これは Directory/.git/config に保存されるので、それぞれのディレクトリごとでなんとかなります。

(既にそのディレクトリにいる前提で)

git config user.name "Sharo_Police"
git config user.email "sharo_police@pfcolle.com"

これでミスも減るね!(自戒)

3
1
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
3
1