Add site from repository with no master branch

I am trying to add a new site to my account but it keeps giving me an error saying the repository is empty or disabled when it has been an active project for years. The only issue I can think of is that the repository doesn’t have a ‘master’ branch just ‘main’ and ‘develop’. Is it possible to add a repository like this?

This should be possible. If there is no master, Netlify should deploy the default branch. Do you mind sending me a screenshot of the error you are getting. In addition, a link to your repository might help me out, if you don’t mind.

Use main instead of master

Sure, the repo is at https://github.com/ubiety/ubiety.dns.core and the screenshot is here.

I just forked your repo and did not get any errors at that point. In the 3rd step of adding a site, Netlify asks for the branch to deploy and no errors occurred.
The best answer I can think of is to click you profile picture in the top right, click User Settings. Scroll to Connected Accounts and unlink then relink your GitHub account. Doing this should allow you to make sure Netlify has the correct permissions to access the repository.
Other than that, this might have to be deferred to Netlify’s support staff.

I unlinked my GitHub account on netlify and uninstalled the netlify app on GitHub and tried again. The same thing, it cannot access that one repository.

If it’s still not working, you can try to temporarily create a master branch, connect it to Netlify and then change the branch to deploy from site settings.

@hrishikesh I don’t think this is an issue with the branches. Netlify should pick the default branch, and selecting a branch occurs in the next step of deployment.

I think this may be because while you are able to edit the website through Github, Netlify cannot access it because it is through an organization that it does not have access to. (See here). It looks like Ubiety is an organization on Github. Do you have administrative privileges to this organization?

When you select a repository, you might have to click the dropdown of your username and select the organization instead!

Update:
You can click add an organization and select it from there.

I didn’t mean to call it an issue with branches. I just thought, while @coder2000 waits to find a solution, they can try a workaround. It might or might not work. If it works, their problem would be solved for now and can continue working and find the root cause of the problem later. If it doesn’t, you and others are already helping them out. I hope you all find the solution soon as I have no idea what’s causing the issue. What you say is right, it should pick up the default branch and all, turns out it’s not working for them due to some reason.

I thinks it’s the organizations permission. I added a screenshot showing how to add an organization, because @coder2000 does not have sufficient privileges to add that repo to Netlify. @coder2000 must add the Netlify app to the organization so that Netlify can clone the repo to build it.

The organization has permissions, I have another site setup for a repo in the same org with no issues.

Did you try to select the organization before selecting the repo? I do think that Netlify does not have permissions, since I was able to fork and deploy the repo. When you get to the page where you choose a repo, try clicking your username and click “Ubiety” or add a new organization.
Because I was able to deploy it, I am going to determine this is a permissions and switching the organization might solve that problem.

I have selected the org. I don’t see the repo otherwise. I agree that it probably has to do with permissions but I don’t see anywhere in Github to change that.

@kalinpatel Do you have any updates? There must be a log showing what failed and why. It has started working.