github: transfer ownership and fork - github

I've transfered ownership of one of my github repositories (rdmuller/docToolchain) to an organisation (docToolchain/docToolchain).
So far, so good. All old URLs are redirected to the new location. Perfect.
But how do I now fork this repository? I fear that, if I fork it, a fork with the name of the old repository (rdmueller/docToolchain) will be created and the redirect will be broken this way...
how can I avoid this?

So, I guess I found a workaround.
suppose you have a repository
user1/repo1
You now want to transfer ownership to org1 and create a fork of it in your account user1.
The problem is that, if you create this fork directly, there will be again a repo called user1/repo1 and github is not able to redirect URLs to the old repository to org1/repo1
Solution:
transfer ownership from user1/repo1 to org1/repo1
create a temporary organisation org2
fork org1/repo1 to org2/repo1
rename org2/repo1 to something like org2/repo1-fork
transfer ownership from org2/repo1-fork to user1/repo1-fork
this seems to do the trick.

Since May 2020, Ben Balter (Senior Product Manager working on Community and Safety at #GitHub) mentions in his tweet:
We're beta testing a new GitHub feature that allows you to invite someone to manage your open source projects in the event that you are unable able to do so yourself.
If you'd like early access, reply or DM with your GitHub handle and I can add you.
See "Maintaining ownership continuity of your user account's repositories"
You can invite someone to manage your user owned repositories if you are not able to.
We recommend inviting another GitHub user to be your successor, to manage your user owned repositories if you cannot. As a successor, they will have permission to:
Archive your public repositories.
Transfer your public repositories to their own user owned account.
Transfer your public repositories to an organization where they can create repositories.

Related

How do you restrict contributors from Pushing to a private repository without a Fork?

Is there a way for me to invite a contributor, allow him to fork from my project and submit a Pull Request, without being able to commit and Push directly into the repository ?
I am new to this, I'm doing some testing and it seems that it should be an easy way to accomplish this, but I cannot find it. I have two accounts and it seems that I can just delete and modify anything in the repository, from the collaborator (guest) account, with no restrictions and moderation from the owner account.

Allow admins (not owners) to create repos in Github

Is it possible to limit who can create repositories in a Github organization. From this article: https://help.github.com/en/enterprise/2.14/user/articles/restricting-repository-creation-in-your-organization it seems like the options are basically owners or everyone. Is there a middle ground?
Making someone a Github owner is a serious permission so we really don't want to give that out just so that someone can make a repo. On the other hand allowing everyone in the organization the ability (contractors, non-technical, read-only roles) the permission to make repos seems too broad.
Has anyone come up with a better solution for this?
One workaround would be to setup a webhook.
That means having a listener for a repository event, which does include the owner: If said owner is not part of an admin list, the listener could:
send back an email to the owner of the newly created repostory, explaining that creation has been denied
delete the repository (through the GitHub API)

fork repo from personal account into organisation acount

I developed a project on my personal github account.
I'm a member (not owner) of an organisation and would like to fork my project in the organisational account, such that the organisation can help maintain it in the future.
How is this done best?
As far as I understood, when I transfer or perform an import into the organisation account from my personal repo, I loose the project in my account which I don't want.
I'm sorry in case this is a "stupid" question - I'm pretty new to git and github...
Any reason not to transfer it, then fork it again back to your account?
That way you can still raise pull requests from your person fork back to the main one.
Thanks for all the answers.
According to the github support team:
Importing is intended to bring code from outside GitHub into GitHub, so that wouldn't be suitable.
and
Transferring would indeed mean you no longer had the repository on your account.
The solution for me was:
requested owner priviledges for the organisation (in case that would not be possible, ask an owner to perform the following steps)
went to the repository which I wanted to fork (In my case, this was on my personal profile and I was logged in with my personal account. I don't have any login informations for the organisation account)
pressed fork and there was a pop-up, asking for where to fork this repo
selected the organisation
I hope to help others in the future with this :-)
you should be able to import without loosing the project in your personal account.
This is what IMO makes the difference between transfer and import.
Be sure to login with your organizational account, if you have two separate accounts

If you add a collaborator to a github public repo can they delete or damage anything?

We are setting up a open source project which we would like to allow freelancers to develop alongside us without damaging anything.
In general can the collaborators make changes to repositories without admins being able to check the changes over before code is merged into master.
What is the best method to use to prevent the repository from user damage whilst working with a large number of public freelance developers / users?
What you can do is you can give them read-only permission. They can fork to their own account and start working on that code. Then after finishing a feature they can create a pull request to merge it back to the main repo.
For a Personal account on Github, there are two types of 'roles' - Owner and Collaborator.
For a full list of who can do what - see here:
https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-personal-account-settings/permission-levels-for-a-personal-account-repository
To answer your question - "No - A collaborator cannot delete a repository"

Transferring the Github Organization ownership

There is a way to transfer the ownership of the repositories in github, but is there is a way to transfer the ownership of a organization completely?
What Github presntly has is a way to add multiple people to the organization's Owners team. And also any owner can be removed from the team by the user who created the organization in the first place. Is there a way to remove that user, and transfer complete control to someone who is there in the team?
To transfer ownership of anything (including a repository, actually) to a different user, you need to contact support.