Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Update local code with pull request from private fork without requesting read access to said fork

Joey St-Laurent July 20, 2021

Hello gang!

Using git

Context:

  1. I have a private repo that I shared (read) to John.
  2. John forked the repo, created a branch, pushed it and created a Pull Request for me to review and then merge into my own repo.

What I can do:

  • See his pull request
  • See his changes
  • See a list of his commits
  • Merge his pull request

What I cannot do (but wish I could do):

  • Click one of his commits to see the diff
  • Update my local code to his Pull Request's branch to test his code locally

My solution was to ask John to give me read permissions to his fork and all is working now.

However, this feels like an unnecessary step. If I have access to his changes and can merge them to my repo, why couldn't I pull them to my local code to test them out? Am I missing something?

I searched online but found nothing that didn't assume I already had read permissions on the fork. Please forgive me if the question was already answered elsewhere.

Thank you in advance for your precious help and may this discussion enlighten others as well.

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2021

Hi Joey and welcome to the community!

In this scenario, did John created the fork under a workspace different than the one that owns the parent repo?

If a repo is owned by e.g. workspace-1 and someone forks it under their personal workspace or any workspace other than workspace-1, we don't automatically give access to the fork to any user of workspace-1. If the fork is owned by a different workspace, e.g. workspace-2, only user groups of workspace-2 will get access automatically (if they are configured for getting access automatically). So, this is a matter of repository ownership.

That being said, I understand the requirement to be able to fetch the PR code locally. This is not possible at the moment without having access to the fork, because PRs are not stored as refs in the destination repo. We have a feature request about this in our issue tracker:

Until this is implemented, a user will need to have access to the fork in order to be able to pull the code of a PR locally.

I also wanted to add here that if
- the repo is owned by workspace-1
- you are an admin of workspace-1, and the admins user group is configured to get access to all new repos in that workspace
- John is a member of a user group of workspace-1 that is allowed to create repos in workspace-1
then John could create their fork under workspace-1, which would give you access to the repo automatically. I just wanted to mention that as a way that would eliminate the step of John giving you access.

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Joey St-Laurent September 15, 2021

Thank you for your answer.

I did what you suggested, giving John permission to create repositories in my workspace.

He then forked the project in my workspace and it worked like a charm.

Kind regards,
Joey

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events