Github Enterprise Admin Manually Add to Repo or Organization
I am the Github Enterprise admin for my organization, and I often have to jump into other organizations repos and wikis. I thought to myself, I should be able to do this by going through the Admin interface or the Management interface, but apparently you cannot.
So here is my cheat sheet for adding myself to other repos or to other organizations.
Adding yourself to a repo:
Sometime you need to just add yourself to a repo that you are not currently a member of. Luckily this is fairly easily done via the Github Admin UI. If you know the organization name and repo name, you can go strait to a link and add yourself as a collaborator. If you do not know the org name, or the repo name, you will have to look it up first.
If you know the organization name and the repo name:
If you know the Organization name and the Repos name you can go directly to the following url to access the repo.
Where ORGNAME is the name of the organization, and REPONAME is the name of the repo.
You will be presented with an unlock stop screen.
From here you can enter a reason like “All your base are belong to me” and enter the repo’s settings page.
From the settings page you can select “Collaborators and teams” and add yourself as a collaborator to the repo.
If you DO NOT know the organization name or repo name:
If you don’t know the name of the Organization or repo exactly, you can look it up.
- Start at your main organization dashboard. This usually has a url something like: https://github.mydomain.com/orgs/orgname/dashboard
- From here, click on your site admin rocket in the upper right corner of the Github UI. Note: If you don’t see this icon, you are not logged in as an admin.
- In the left hand side, Site Admin menus, click on the Organization menu.
- Click the link to the organization that owns the repo that you want to access.
- In the Admin menus look for the Repositories link.
- On the left hand side, you can select either the private repos, or public repos. You should now see a list of the organization name and the repo name. You can now use the url above to enter the settings area.
Adding yourself to an Organization:
Adding yourself to an organization is a bit trickier. You have to do it from the ssh github enterprise console itself.
For this you will need to have access to the Github Management Console in order to add your ssh key to the github appliance.
- Start at the rocket again.
- On the left menu enter the “Management Console”
- Enter the super secret management console password
- Add your SSH key to the admin Authorized SSH keys.
- Once completed you should be able to login to the github appliance via the command
Shell1ssh -p 122 email@example.com
Shell123456789101112___ _ _ _ _ _ ___ _ _/ __(_) |_| || |_ _| |__ | __|_ _| |_ ___ _ _ _ __ _ _(_)___ ___| (_ | | _| __ | || | '_ \ | _|| ' \ _/ -_) '_| '_ \ '_| (_-</ -_)\___|_|\__|_||_|\_,_|_.__/ |___|_||_\__\___|_| | .__/_| |_/__/\___||_|Administrative shell access is permitted for troubleshooting and performingdocumented operations procedures only. Modifying system and application files,running programs, or installing unsupported software packages may void yoursupport contract. Please contact GitHub Enterprise technical support firstname.lastname@example.org if you have a question about the activities allowed byyour support contract.
- Once at the command line, you can then use the following command.
Shell1admin@github-mydomain-com:~$ ghe-org-admin-promote -u cmarsh -o orgname
Shell1234--> Adding cmarsh as an admin of orgname--> cmarsh is now an admin of the orgname organization--> Done.admin@github-mydomain-com:~$
And thats all for now.