How to Remove Github Repository Redirects Across Name Changes

Alex Hong
2 min readOct 2, 2017

--

A while back, I switched Github usernames so that I could have a formal username that wasn’t associated with my regular games/Reddit username. However I realized after switching even though my old profile was “deleted”, the repository links were not. Let me give an example.

Let’s say your username is old_user, and you profile was github.com/old_user. You switched to a new username, new_user, and your new profile was github.com/new_user. Any old repository you had (i.e. github.com/old_user/repo1) would redirect to your new repository (github.com/new_user/repo1). Even if you later change your new repository name to repo2, the original link would still redirect to your new repository with the new name.

Obviously this was an issue because I wanted to minimize the links between my games/Reddit profile to my real name. I first attempted to get in contact with Github support, but was given the following response:

Hi there, ~!

This behavior is to be expected. This guide explains what happens when you change your username on GitHub:

https://help.github.com/articles/what-happens-when-i-change-my-username/

I’m afraid there is nothing we can do to fix this!

Well, that’s not very helpful. According to Github, these links are permanently in place, and cannot be redacted in any normal fashion.

The solution I tried was thus overriding the link entirely. I created another Github profile named old_user, and created another repository with the same name repo1, so github.com/old_user/repo1 didn’t redirect at all. Hooray, it worked!

My only issue with that was the repository name I had was fairly obscure, so if you looked it up on Google, you could still link it to my actual profile. I wanted 100% separation, so I made one last change.

By changing the name of repo1 on old_user’s account to something completely different, like unicorns, github.com/old_user/repo1 would now only redirect to github.com/old_user/unicorns. The only last thing you would have to do is request a removal of Google’s cache through their website here.

One thing to note is that despite all this, if you delete this new unicorns repository for whatever reason, github.com/old_user/repo1 will once again redirect to github.com/new_user/repo1 or whatever name you change repo1 to. These redirects are really persistent!

*Note that all of the usernames and repositories are examples only and do not actually exist as of this writing.

--

--