プログラミング

git pushするユーザーを変更する方法

git push のpermission denied errorに悩まされて。
windowsは資格情報マネージャとかが面倒。といってもBash on windowsだと対話はしてくれる。
httpsだと出来ないのでsshの手順を踏む。

大まかな流れ

$ cat ~/.ssh/id_rsa.pub |clip
SSH-keyをgithubに追加する。
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

$ git config user.name “Mona Lisa”
local-config の user を任意のユーザー名に変更。

$ git remote add git@foobar.git
Remote repository の ssh を remote add する。

yes/noとパスフレーズ入力をして、pushできたらok.

ところで、user.emailってなんの意味があるんだろう…。

References:
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
https://help.github.com/articles/setting-your-username-in-git/
https://help.github.com/articles/changing-a-remote-s-url/

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です