Add collaborator to many repositories at once - github

We have 150+ repositories on our GitHub, for different clients. Now we hired new employee to take care of the managed services process and he requires access to all the repositories. Inviting him as a collaborator to all repositories one by one is going to take plenty of time.
Is there a way to add him to all repositories at once? A command or some trick in GitHub that I do not know.

If those GitHub repositories were all part of the same organisation, that would be easy: see "Inviting users to join your organization"
If not, you can script that with the GitHub API:
list all your repositories
for eeach repo, add your collaborator to it.

Related

Git hub Organization

I have a problem in creating a git organization. The problem is, I already created a Git organization, but then a deleted it. When I tried to create an organization with the same name. It says its unavailable.
Citation from Github Docs:
When you delete an organization, all repositories, forks of private
repositories, wikis, issues, pull requests, and Project or
Organization Pages are deleted as well. Your billing will end, and
after 90 days the organization name becomes available for use on a new
user or organization account.
I guess, you should wait for 90 days, or try another name.

Disown a private organization repo on GitHub

I still own and contributed to a few private repos in an organization account of my former job. Currently I don't have access to these repos, but keep getting notifications from them. Is there a way to disown or remove myself from these repos? Going to "Repositories" in Settings doesn't help, as these repos are not listed there.

GitHub repository as contributor

I created a repository and added a contributor, and this was our mutual work. In my GitHub account it appears as a repository and in his account is does not.
We want that his account will have this exact same repository as shown in my repos.
How can we do it? :)
Each repository is owned by a single individual or organization account. If you store your repository under your personal account, you would be the owner and your colleague can be made a collaborator. In this case, like you mention, the repository would be listed only in your account's repository list. To give equal "credit" to your collaborator, you could do one of the following:
Pin the repository: Your collaborator can pin any repository they contributed to to their profile page. While the repository would still appear under your name, it will be prominently visible on your collaborator's profile.
Create an organization: You could create an organization where both of you are owners. The repository will then appear in neither of your individual profiles, and both your individual accounts can be publicly listed as members of the organization.

How to restrict read access/visibility of a repository?

In the azure doc it is recommended to use as few projects as possible in one organization.
Now I have the scenario that I need to restrict read access to certain Git repositories.
How would I accomplish that?
From what I have seen in the documentation and devops itself I have the feeling that I have to create a dedicated project and restrict the access to the project to which those repositories belong to.
If I now see the URL of a Git repo I cannot even see the project name at all. Does that mean that GIT repositories belong more to an organization than to a project?
Thank you for your support
Git repo belongs only to a project. To restrict access you can:
Create new security group: Project-level groups
Add it into Git repo groups and deny Read access. Set Git repository permissions

Accessing forks in private GitHub repository

I am the owner of a private GitHub repository. Somebody else (student1) forked it a while ago and has done some work on his fork. Now I need somebody else (student2) to pull those changes and work off of them. However, he cannot access student1's fork at all. Trying to git pull provides an error about not being able to find it. Student2 can also not see student1's fork on GitHub's website.
Everybody is added as a collaborator. I can access all forks (I am the original owner of this repository). I tried removing student2 and adding him back but it changed nothing. I tried inviting another friend (let's say student3) and he can fork but also cannot see other forks. In the past, I distinctly recall any users added as collaborators being able to pull from other forks so I am not sure why this isn't working.
All I see is "Find another repository to fork"
You can fork any private repository you can access to your user account or any organization on GitHub Team or GitHub Enterprise in which you have repository creation permissions.
Maybe this is possible through an organization, where you can change member privileges.