How do I make a readonly mirror of my github repo? - version-control

We need to have a read only github repo that mirrors our main branch.
I've noticed castle have managed to do it with their entire collection of repositories.
How would I go about achieving this?

Castleproject is an organization (also mentioned here) in order to restrict write access.
That is why you see read-only addresses on their projects.
That also means it (ie the organization "castleproject") can add users with read-only rights.
As a simple user owning a GitHub repo, you wouldn't have access to that feature.
You need to define an "organization".

I believe this is what you are looking for right here:
http://justcramer.com/2011/05/09/creating-a-one-way-git-server-mirror/

Related

Adding permissions to github repository only

I have an organization and want to add granular permissions for each repo. This does not seem possible and the docs send me to "Setting the base level permissions" which I do not want.
github docs
Answer is adding a person in the Settings of each repo. Should be in the docs.
Also, this is a stupid and dangerous way of adding people in an organization as I could easily add someone to this repo from outside the organization if I'm not careful. Very, very stupid. I should only be able to add people from WITHIN my organization, that's the entire f... point of having one in the first place.

how to allow 3rd party to create repo (repo transfer) in our Org without let them see our private repo?

We have hired a 3rd party to work on a project, we started by not creating any Repo on our Github, but they started with their Repo. So now it's time to transfer the repo. However, in order to transfer the repo, the developer is asking permission to create a Repo in our Org... but as far as I know, I can only invite him first as a collaborator, a member, before he can create any private repo in our Org... that means he can see our other repo...
I couldn't find any good answer online, please help. Thanks!
Have you tried using Github's Organization features? You can create an organization with your team members in it, and control who has access to what.
Here's a Github page that explains a bit more about how it works.
Do not add them as a member to your Org! (this is the only option today from Github, nor owners...of course). If you do so, this will give your external developer access to all of your repos.
The only way I found you can safely invite an external user is to create a Repo first, then add them in that Repo. By doing that, they will be invited only to that repo, and have no access to the others.
This is my workaround. If you have a better solution, please do comment. I am curious how the "transfer" feature works.

Can I make sure no one forks my GitHub repo but still allow the work to be seen by recruiters?

I am now building portfolio to get my first tech job. I would like for any recruiters/potential employers to see my code in case they want to see how I am putting things together but I don't want anyone to be able to fork or copy my work.
How is this possible?
If I have a private GitHub repo does that mean that you can see the repo but just not the inner contents? I have looked at the GitHub documentation already.
If I have a private GitHub repo does that mean that you can see the repo but just not the inner contents?
If you can access a repository (public or private), that means you can read its content and/or clone it (and read its content locally)
You would need to setup a private repository dedicated to show your file
names, meaning a collection of files with:
dummy content
the exact names and folder structure than your actual projects.
That way, you can share to select collaborator access to that "showcase" repository, without compromising the sensitive content of your actual project repositories.

How to prevent pushes to a private repository in Github

We have a repository in GitHub. We want a group of developers to be able to view and fork this repository. But we'd like to prevent them from committing to our branches. Instead, we want this group of developers to fork the repo and create pull requests to contribute. Is there any way to achieve this in GitHub?
Access control is no longer available for private repositories. Both read and write access is given to the collaborators.
If a collaborator will have only read access to a repository, you must create an organization.
You need to add collaborator to your repository and give them just read access, look following article:
https://help.github.com/articles/adding-collaborators-to-a-personal-repository/

Teams that have read access to all repositories of an organization

in my Company, we've got a lot of repositories in one private github organization (not accessible publically). Ideally, all developers should have read access to all repos in that organization, while just having write access to the repositories of their project.
For that, I've set up a couple of github teams (for each project). Each of that teams should have write access for some repositories (easy to configure in the repo settings) but read access for all other repositories. I'm struggling with this one, as I can only grant read access to each individual repository. This is not only painful (because we have a lot of repositories) but will also not automatically work when new repos are created.
Is there anything, I'm missing to set this up properly?
Thanks, Matthias
You need to do it manually only as github doesn't provide this functionality.
All team members within the organization will have read-only access by default I believe (they can read and clone repositories).
If you want to give write access to certain teams, rather than go to repo settings, go configure in the team settings. Try this, maybe it will work:
create team, add members
add repositories in the respective tab, for which you want to provide write access to the team
under Settings, give write access (which will apply to the repositories added above against the team)