I’m a little confused whether non-bare repositories are supported in Gitea and how to use them.
Gitea used to have a
is_bare flag in the database, which suggests that both bare and non-bare repositories are or at least used to be supported?
Why I want to use non-bare:
I want to use non-bare repositories because I need to commit something locally from scripts but at the same time I need gitea to do it’s magic (like accepting pull requests). I need to be able to commit new and changed files via script (
git commit), without manual intervention. I also don’t want any merge commits (non-FF).
I would use the Gitea API to commit the changes directly to Gitea, but as opposed to
git commit it does not support setting author date and commit date, which is a hard requirement.
I cannot just automatically “push” the changes to gitea with a post-commit hook, because that would fail if the Gitea bare repository changed in the mean time.
I just want a single repository I can work with (so it’s needs a working tree) and uses Gitea as well - that’s why I want to use non-bare repositories in Gitea.
What I tried:
I am using Gitea 1.10.1 (mysql) with git 1.9.1:
- when I create a new repository from Gitea UI, it is bare (obviously). There is no option to create a non-bare repository
- when I manually create a non-bare repository in a destination path that Gitea will later use, and create the repository from Gitea afterwards, I get a HTTP 500 error and Gitea will delete the entire directory
- when I create the repo within Gitea and replace the directory with a non-bare repo, when recreating hooks, Gitea will assume this is a bare reprository and install the hooks in ./hooks/ as opposed to .git/hooks/ (for a non-bare repository).
Can anyone shed some light on this?