LoginSignup
0
0

More than 3 years have passed since last update.

Gitで複数アカウントを使った時に困って使ったコマンド集

Posted at

Gitで複数アカウントを使った時に困って使ったコマンド集

macを使っています。
備忘録的に書いてみました:bow_tone1:

グローバルのGitユーザーを確認

git config --global --list

ローカルのGitユーザーを確認

git config --local --list

ローカルのGitユーザーを設定

git config --local user.name "hoge"
git config --local user.email "hogehoge@email.com"

すでにしてしまったコミットのAuthor、Commiterを確認

git log -1 --pretty=full

すでにしてしまったコミットのAuthor、Commiterを修正

git filter-branch -f --env-filter "GIT_AUTHOR_NAME='hoge'; GIT_AUTHOR_EMAIL='hogehoge@email.com';GIT_COMMITTER_NAME='hoge'; GIT_COMMITTER_EMAIL='hogehoge@email.com';" HEAD
0
0
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
0
0