Collaborating on Private Repo

Disclaimer: I am not entirely comfortable with the more nuanced functionality of Git.

Hi, I own a private repository that I have invited a friend to collaborate on. We’re working on a Unity project and at some point I decided to make a branch to explore an alternative implementation to something. I also seemed to have changed the default branch to that branch because I preferred the alternative implementation. I believe the collaborator joined after this switch.

A couple weeks ago I decided to merge the branch into master and start working primarily from master again. The collaborator was not able to see any changes I had made to master, so I tried switching the default branch back to master. Still no luck.

I want us to both be able to push and pull on the master branch. What do I do to make this happen?

Are you referring to Git or GitHub? That’s different. If you just have local modifications using Git, of course, that will not be seen.

If, in case, it’s already on GitHub, make sure first that it is really there. You can provide screenshots here so that I can see that also. I can guide you in case you are just stuck somewhere else.

I believe this is a GitHub privacy setting issue. I have been able to push changes to the alternative branch and have him pull them just fine, but my collaborator does not see any changes after the 7th.

Did you create the master branch? Because GitHub already changed the default term from master to main, so I am wondering that maybe you manually created the master branch.

Would main be another branch? I only have master and the other.

When did you create the repo on GitHub?

main is the default now, so I think, that is the confusion. Do you have the main branch on GitHub? Please check it. There should be.

Maybe this would help:

I made the repo in June of 2020. Here are all the branches listed on the page.

Yup, that was the time GitHub announced that. So, just follow the steps mentioned from the blog to change that to main.

If someone has access to your repository, they have access to all branches. There’s no way to restrict read access to specific branches. And while I’m in favor or renaming master to main, either should work just fine.

Which makes me think the problem is likely on you collaborator’s local device. Can they see all branches if they run git remote show origin (replace origin if they use another remote name)? Is the repository URL correct?

1 Like

Not exactly sure what the problem was, but it does seem to have been a local issue that resolved itself when I had them share their screen and try to show me what was going on. Could’ve been an internet connection thing.
Although I will mention again that the master branch was not listed as active on GitHub before or after I made it the default branch, but main is now considered an active branch. Not sure what was going on there or if it had anything to do with our issue.

1 Like