I have a GitHub user account that I use for work.
I wish to upload some code that I have written outside of work and make public. Is there a way to mask my username from the public, so work could not see it was me?
Or would I need to create a separate account to upload the code?
Most people will use one personal account for all their work on GitHub.com, including both open source projects and paid employment. If you're currently using more than one personal account that you created for yourself, we suggest combining the accounts.
Definitely keep them separate. Sometimes, depending on whether or not you have side gigs, you might want more than just those two. There's just no reason to risk it by having one account for both. Even if there are no conflicts with your work, what happens when you inevitably move on to another role?
GitHub recommends using only one user account to manage both personal and professional repositories. Organizations make it easy to contribute to projects for work, open source, and yourself, all from the same account. There's no need to switch accounts in your browser or manage multiple credentials on the command line!
Github recommends to use one account for private and for business use. For this you can use multiple mail-addresses. There is also a documentation for what you (as employee) should do if you leave. This includes also to remove the mail address.
See the top of the GitHub help page called What's the difference between user and organization accounts?:
Your user account is your identity on GitHub.
Therefore, if you don't want your workplace to be able to identify that you're the author of some personal (i.e. non-work-related) stuff that you've made public, you need to create and use a different GitHub account for that personal stuff.
For instance, use an account called panthro_at_work
for work-related repositories and another account called mystery_man_or_woman
for your personal stuff.
However, also be aware that
One person or legal entity may not maintain more than one free account.
See Account terms and also nulltoken's answer. Therefore, in order to hold two accounts, at least one of them should be a paid account.
Should you change your mind (at a later stage) about keeping work and personal stuff separate, GitHub allows you to merge your two user accounts; see Merging multiple user accounts.
GitHub allows for even more fine-grained actions than that: you can transfer ownership of only a subset of your repositories in your mystery_man_or_woman
account to your panthro_at_work
account (or vice versa); see How to transfer a repository.
I wish to upload some code that I have written outside of work and make public. Is there a way to mask my username from the public, so work could not see it was me?
Any activity performed against a public repository is also public. For instance, the public activity for the user Octocat can be seen at the following url https://github.com/octocat?tab=activity
Or would I need to create a separate account to upload the code?
I would advise you to take a also take a look at the GitHub Terms of Services which specifically states: "One person or legal entity may not maintain more than one free account."
So, although the system does allow one to create multiple accounts, GitHub legally reserves the right to ban you, at its own discretion:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With