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

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.

Related

Pushing files from one account to other in github

Iam trying to push some changes to other account from another account but it is giving me permission error.I checked the github settings but everything there seems to be right.Can anybody help me with this?
EDIT:
I tried changing my user name and email too still it is giving same error
Some info about the transfer process which might help you
When a repository is transferred between two user accounts, issue assignments are left intact. When you transfer a repository from a user account to an organization, issues assigned to members in the organization remain intact, and all other issue assignees are cleared. Only owners in the organization are allowed to create new issue assignments. When you transfer a repository from an organization to a user account, only issues assigned to the repository's owner are kept, and all other issue assignees are removed.
If the transferred repository contains a GitHub Pages site, then links to the Git repository on the Web and through Git activity are redirected. However, we don't redirect GitHub Pages associated with the repository.
All links to the previous repository location are automatically redirected to the new location. When you use git clone, git fetch, or git push on a transferred repository, these commands will redirect to the new repository location or URL. However, to avoid confusion, I strongly recommend updating any existing local clones to point to the new repository URL. You can do this by using git remote on the command line:
$ git remote set-url origin new_url
Add the collaborator from the initial account (the git account having the repo) and the second account can accept the invitation to be a collaborator
This allows you to change and push the code from different Id also.

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.

How to access private repositories on Github and Bitbucket without permission of admin

So, my question is:
How to access private repositories of Bitbucket/Github or any other online web-based version control repository hosting service.
Any feedback is most welcome.
Thanks
Steve Washer
I'll only speak for github as a daily github user. The only way to access them is either by being member of the repository or outside collaborator of the repository. Owner of the repo can add you to it in the repository Settings.
Another way is to ask any of the members to provide you the personal access token, which you could use to read the repository via the API. This is however, unsafe.
Yet another way is asking the repository owner or any repo user to add your public SSH key to his account so you may have repo access (clone, commit) without ability to view it on github.com
Summary: you always need to talk to the owner or any of the current repository members. Private repo will never be accessible otherwise.

How to permit customer to only read specific branch in VSTS/Azure DevOps

I have a VSTS/Azure DevOps project with a git repository containing different customer branches. I would like to permit each customer to read-only their own branch. How can I achieve this?
The access control settings do not allow me to set read permissions on specific branches, only on entire repositories. So is it perhaps possible to have a separate repository for each customer that automatically mirrors just the corresponding branch in the master repository?
You can't specify the permission directly in branches (branch level). However, you can inherit/modify the permissions from the repo level to branch level.
See my similar answer here
As you stated in your question. You should create separate repos for different customer where you can control the permissions.

Limit a collaborator to only push to a specific branch

Is it possible to set up a collaborator to only pull/push from a specific branch. Or for that matter, not be able to make changes to Master?
If your repository belongs to an organization, you can enable branch restrictions settings and choose who can push to restricted branches.
https://help.github.com/articles/about-branch-restrictions/
https://help.github.com/articles/enabling-branch-restrictions/
Revoke write access completely and make them fork the repository and submit pull requests.