Help with: This repository doesn’t have any branches

Hello, folks.

Gitea 1.23.1 in docker. Default installation, no extra env variables provided.

Since yesterday (I didn’t update anything about gitea) I’m unable to create branch in new repo.

What I do in web ui:

  1. “+” - New repository.
  2. Name it somehow uniq (let’s say myrepo).
  3. Create repository (without any templates or initializing).
  4. See recommendations about pushing existing repo or creating new one.

If I update the page I see “This repository doesn’t have any branches”.

Then if I try:

git init
git checkout -b main
git add .
git commit -m "First"
git git remote add origin git@git.example.net:user/myrepo.git
git push -u origin main

I got:

...
remote: Resolving deltas: 100% (30/30), done.
To git.example.net:user/myrepo.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.

In web ui I update repo page and again see “This repository doesn’t have any branches”.

I’ve tried from admin panel:

  1. Resynchronize pre-receive, update and post-receive hooks of all repositories.
  2. Sync missed branches from git data to databases.

I still see no branches. From web ui I’m also unable to create a branch - there is no commit tab or branch tab.

What do I do wrong?

Hi,

not sure how to fix this from within gitea or what exactly went wrong (i. e. why gitea seems not resetting the is_empty flag upon commits), but this workaround me be helpful:

  1. First check for repositories with is_empty flag set true directly in the database:
    SELECT * FROM repository WHERE is_empty=true;
  2. Then manually flip the flag:
    UPDATE repository SET is_empty=false WHERE id=<<...>>;

Hope this helps.