Repository seems empty after pushing two branches #2326

Closed
opened 2025-11-02 04:32:56 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @lfuerderer on GitHub (Sep 12, 2018).

Description

When I create a new, empty repository in the web view and push two branches at the same time using one git push command, the repository still appears empty in the web view.

Steps to reproduce

  1. Create a new repository with the web browser. Leave the checkbox "Initialize Repository" empty.

  2. Clone the repository and create a commit.

     lukas@laptop:~$ git clone https://try.gitea.io/LukasFuerderer/Test.git
     Klone nach 'Test' ...
     Username for 'https://try.gitea.io': LukasFuerderer
     Password for 'https://LukasFuerderer@try.gitea.io': 
     warning: Sie scheinen ein leeres Repository geklont zu haben.
     Prüfe Konnektivität ... Fertig.
     lukas@laptop:~$ cd Test
     lukas@laptop:~/Test$ touch dummy
     lukas@laptop:~/Test$ git add dummy
     lukas@laptop:~/Test$ git commit -m "Create dummy file"
     [master (Basis-Commit) 518f855] Create dummy file
      1 file changed, 0 insertions(+), 0 deletions(-)
      create mode 100644 dummy
     lukas@laptop:~/Test$
    
  3. Create a second branch.

     lukas@laptop:~/Test$ git branch branch2
     lukas@laptop:~/Test$
    
  4. Push both branches using only one push command.

     lukas@laptop:~/Test$ git push origin master branch2
     Username for 'https://try.gitea.io': LukasFuerderer
     Password for 'https://LukasFuerderer@try.gitea.io': 
     Zähle Objekte: 3, Fertig.
     Schreibe Objekte: 100% (3/3), 222 bytes | 0 bytes/s, Fertig.
     Total 3 (delta 0), reused 0 (delta 0)
     To https://try.gitea.io/LukasFuerderer/Test.git
      * [new branch]      master -> master
      * [new branch]      branch2 -> branch2
     lukas@laptop:~/Test$
    

Both branches are now pushed to the git repository in the background. If I clone the repository to a new location, they are visible.

But the web view still shows an empty repository. I can see the "Quick Guide" giving instructions how to create the first commit.

Screenshots

Creating the repository:
create-repo

After pushing both branches:
after-push

Originally created by @lfuerderer on GitHub (Sep 12, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.5.1 - Git version: 2.17.1 - Operating system: Ubuntu 18.04 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes, https://try.gitea.io/LukasFuerderer/Test - [ ] No - [ ] Not relevant - Log gist: ## Description When I create a new, empty repository in the web view and push two branches at the same time using one `git push` command, the repository still appears empty in the web view. ### Steps to reproduce 1. Create a new repository with the web browser. Leave the checkbox "Initialize Repository" empty. 2. Clone the repository and create a commit. lukas@laptop:~$ git clone https://try.gitea.io/LukasFuerderer/Test.git Klone nach 'Test' ... Username for 'https://try.gitea.io': LukasFuerderer Password for 'https://LukasFuerderer@try.gitea.io': warning: Sie scheinen ein leeres Repository geklont zu haben. Prüfe Konnektivität ... Fertig. lukas@laptop:~$ cd Test lukas@laptop:~/Test$ touch dummy lukas@laptop:~/Test$ git add dummy lukas@laptop:~/Test$ git commit -m "Create dummy file" [master (Basis-Commit) 518f855] Create dummy file 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 dummy lukas@laptop:~/Test$ 3. Create a second branch. lukas@laptop:~/Test$ git branch branch2 lukas@laptop:~/Test$ 4. Push both branches using only one push command. lukas@laptop:~/Test$ git push origin master branch2 Username for 'https://try.gitea.io': LukasFuerderer Password for 'https://LukasFuerderer@try.gitea.io': Zähle Objekte: 3, Fertig. Schreibe Objekte: 100% (3/3), 222 bytes | 0 bytes/s, Fertig. Total 3 (delta 0), reused 0 (delta 0) To https://try.gitea.io/LukasFuerderer/Test.git * [new branch] master -> master * [new branch] branch2 -> branch2 lukas@laptop:~/Test$ Both branches are now pushed to the git repository in the background. If I clone the repository to a new location, they are visible. But the web view still shows an empty repository. I can see the "Quick Guide" giving instructions how to create the first commit. ## Screenshots Creating the repository: ![create-repo](https://user-images.githubusercontent.com/37334661/45414828-7f22ff00-b67c-11e8-96e9-b2d05cb0538a.png) After pushing both branches: ![after-push](https://user-images.githubusercontent.com/37334661/45414857-8b0ec100-b67c-11e8-84f0-9828ce2319f0.png)
GiteaMirror added the type/bug label 2025-11-02 04:32:56 -06:00
Author
Owner

@lafriks commented on GitHub (Sep 12, 2018):

Does it work for you with single branch?

@lafriks commented on GitHub (Sep 12, 2018): Does it work for you with single branch?
Author
Owner

@lfuerderer commented on GitHub (Sep 12, 2018):

Yes, with a single branch everything is fine.
Only if there are at least two new branches on the first push to the repository, the error occurs.

@lfuerderer commented on GitHub (Sep 12, 2018): Yes, with a single branch everything is fine. Only if there are at least two new branches on the first push to the repository, the error occurs.
Author
Owner

@lfuerderer commented on GitHub (Sep 12, 2018):

Update: There seems to be another condition that I did not recognize before.

To reproduce this bug, every branch that is part of the first push must point to the same commit. In the scenario I described above, I have two branches on the same commit so the condition is fulfilled.

@lfuerderer commented on GitHub (Sep 12, 2018): Update: There seems to be another condition that I did not recognize before. To reproduce this bug, every branch that is part of the first push must point to the same commit. In the scenario I described above, I have two branches on the same commit so the condition is fulfilled.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2326