LoginSignup
4
3

More than 5 years have passed since last update.

GitHubやBitbucketのユーザー名を変更する方法とその後やること

Last updated at Posted at 2016-12-22

なんとなく決めたユーザー名を長年使っていたものの、気に入らなくなってきたので変えました。変更自体は簡単ですが、その後の処理はやはり大変です。

githubは少し親切で、旧ユーザ名が別のユーザーに取得されるまではリポジトリをリダイレクトしてくれます。bitbucketはそれがないため、すべてのローカルリポジトリに対して変更を行う必要があります。

githubユーザー名の変更

プロフィール写真 -> settings -> account -> change username(環境が英語のため)

本当に良いの?

変更画面

Bitbucketユーザー名の変更

プロフィール写真 -> Bitbucket settings -> Bitbucket profile settings -> Username (change)

変更画面

変更後にやること

old_nameからnew_nameに変更したとして

# これを
$ git remote get-url origin
git@bitbucket.org:old_name/repository.git

# こうして
$ git remote set-url origin git@bitbucket.org:new_name/repository.git

# こうなる
$ git remote get-url origin
git@bitbucket.org:new_name/repository.git

当然この他にも色々やることや不具合が起こる可能性があります。変更は自己責任で!

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