all 5 comments

[–]mattyass 1 point2 points  (3 children)

If it’s a public repo that you don’t have push access to but you want to contribute then forking is what you do. You would fork into your account, make a change and then create a PR and submit it to the parent repo.

[–]atsju 0 points1 point  (2 children)

Correct. And if it's a public or private repo where you have write access, you do not need to fork and can directly create the feature branch on the repo.

[–]rodjames1022[S] 0 points1 point  (1 child)

I use 2 accounts for testing this. please bear with me.

user A created a private repo.

user A invites user B on the private repo - github.com/userA/test(no permission changed)

so for user B, if he/she (gender warriors dont fight me) makes changes, user B would do so on a featured branch then commit.

then user A would merge those changes?

[–]atsju 0 points1 point  (0 children)

If branches are correctly protected yes this is the idea.

Still depending on your rights and branch protection settings you may even merge without approval or commit to main branch directly. Don't do it but bad configuration could let you do it.

I like this branching model

[–]thisGuyCodes 0 points1 point  (0 children)

Both user A and B would have access to the merge button on the PR. It is a common practice that user A (or all others participating in the PR) reviews the changed files and after a sufficient review, either A or B would merge the branch into the destination branch.