LoginSignup
1
1

More than 3 years have passed since last update.

githubに別アカウントでプッシュする方法 - 間違えて他のgithubアカウントでpushしたとき

Posted at

間違えて会社のアドレスで作ったGitHubアカウントじゃなくて私用のアカウントでcommitしpushしたとき、見ず知らずのアカウンが、チーム開発のリポジトリのcommitに乗ってしまうことがあります。

そんなときは、ローカルで、下記のように実行して直して

% git config user.name ryosuke.fujisawa 
% git config user.email ryosuke.fujisawa@社用アドレス.com

んで、確認して

% git config user.name   
% git config user.email 

上記のコミットは間違って私用アカウントでpushしたものですよとチームに伝わればok

 % git commit --allow-empty -m "gitユーザーの変更"
 % git push
1
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
1
1