Accessing forks in private GitHub repository - github

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.

Related

GitHub private - collaborator cannot access the repository

One of our users create a private repository within and organisation on GitHub Enterprise. He added a collaborator, but this person get 404 error when trying to access the repo. I added my account to this repo and all works fine for me.
Added collaborator is in the same organisation, repo is visible on his profile, link to repo is fine too (it works for me and repo owner).
I was searching the answer in Internet, but no luck.
Do you have any idea, what can cause this situation?
This usually happens because the user who is having an issue's client isn't properly authenticating.
You can read more about it here: https://developer.github.com/v3/troubleshooting/

Can I request github to delete an existing fork of my private repo?

I made a repo just now and commit the first version. This repo should be made private. During the time when finishing payment and changing from public to private, someone has forked this repo.
I read the introduction of github, it says If I change a public repo to a private one, the existing forks will be kept in a separate network, it means it will still exists.
So I want to know, can I request github workers to delete this existing fork? I must keep this repo private, it has some confidential information. I think github worker should help to make it.
You can, but any local clone of that fork can then be pushed again to a new non-forked repository. Created on GitHub or elsewhere.
So it really depends on when that fork was created: if it was after you started to put confidential information, said sensitive data are not safe (ie could be made public again) even if the fork were to be deleted.

Can a github collaborator commit their changes to a public repo?

I was added as collaborator to a public GitHub repo and I was able to make changes to the main branch. A pull request was not generated, the changes just went right in. I am using Visual Studio 2015 as my client, for what it's worth.
Yes, it depends on the permission.
There are 4 types of permissions:
Read
Write
Admin
Owner
Note: Organization members with owner permissions have extensive permissions across all repositories in an organization.
See the permissions and associated actions at Repository permission levels for an organization and Collaborator access on a repository owned by a user account.
Yes, it is either your responsibility to properly follow process (i.e., create a branch and then create the pull request to merge to master / release / etc) or/and up to the repo owner to set up permissions so committing directly to master is not possible.
Yes, that's basically what collaborators are. :)
See Github - Collaborator access on a repository owned by a user account
Often, even if you have collaborator access/rights, you can choose to adopt a more kosher Git workflow, like creating a branch and a pull request for each 'thing' that goes into the main branch.

Github - Removing collaborators after they fork a private repo

My organization has a private repo and we've brought on a few contractors and given them access to the code base.
These contractors have been forking the code base, and I wanted to evaluate the potential security implications of that.
Could any of these forkers make the code public if they choose to?
If their access is removed from the original project, will their access to the forked repo also be removed?
Could any of these forkers make the code public if they choose to?
Yes, they can push it to a new public Git repo (on GitHub or any other Git hosting service)
If their access is removed from the original project, will their access to the forked repo also be removed?
See "Removing a collaborator from a personal repository"
While forks of private repositories are deleted when a collaborator is removed, the person will still retain any local clones of your repository.
For a better security, contractors usually operate on PCs inside the organization through VPN. Those PCs can then limit or prevent internet access.

How do you change the default base fork for a github pull request? [duplicate]

I have a set of documentation for my company's API, based on the excellent Slate framework from TripIt. Per instructions, I forked their repo and proceeded to customize it. That fork lives here.
The obnoxious thing is that when contributors in my organization do a new pull request, the "base fork" on the Github "Comparing Changes" screen defaults to TripIt's repository, not my fork. They've more than once sent pull requests to the wrong place. Telling people "don't do that" isn't a particularly reliable solution. How can I set the default for where PRs are based to my fork?
GitHub keeps track of forks made through their interface and assumes pull requests will be for that original repository. You need to tell GitHub that your copy is not a fork but rather a regular repository that just happens to have identical history. Sadly, GitHub doesn't offer a good way to just uncheck the fork link. I typically solve it this way:
Clone the repository, git pull, and ensure your local copy is completely up to date.
Delete the repository on GitHub.
Create the repository on GitHub using the exact same name. Ensure it's an empty repository (don't create a README or LICENSE file.)
git push all the content back into the repository. (You may need to switch to each branch and push it, and you also may need to git push --tags.)
FRAGILE: This approach will lose existing GitHub issues and pull request comments. If you're using these heavily, this approach is probably a bad idea, and you should contact GitHub customer support to help you instead.
It is unfortunate that GitHub does not provide a way to configure the default PR target repo.
If you can delete (or get the owner to delete) the original repo A from which B was forked, then that will do the trick.
If it is not possible/agreeable to delete A, but the owner of A is willing to do the following, then the fork link gets broken, on GitHub Enterprise at least:
mark repo A as Private
mark repo A as Public again
After doing this, repo B (which was originally forked from A) will default to opening PRs against itself, rather than A.
Note: if A itself was forked from something further back in the history, then unfortunately it seems that B starts defaulting to opening PRs against that repo once A has gone. The only solution would be to apply the above to all repos upstream in the fork tree :(
Your other developers seem to have forked TripIt's repository, so that is the source/parent of their work.
In fact, if you open your own repository, you will see it hasn't been forked at all (the fork count is 0).
When they issue a merge request, by default github shows that repository as source, and so the pull request isn't sent to you.
The simplest workaround in this case is to ask your dev's to fork your repository, and work on it.
Yes, it's a bad situation...
The only solution I know of (other than deleting the fork and recreating/pushing directly from a local clone as described here ) is to have the upstream owner make the original repo PRIVATE and then return it to PUBLIC. Taking it private breaks the link to forks permanently.
But of course that requires action by the upstream owner. Github should really solve this, but it's been an issue for a very long time.