Gitblit Duplicate Repo Bug
Logging this because it was kind of difficult to track down.
We have a Gitblit instance running for our developer repository on a Fedora machine. It really is a wonderful tool; up and going practically out of the box.
But one of the problems we have been having is that duplicate names for the same repository show up in Gitblit on occasion. The code doesn’t seem to be affected; needless to say it’s annoying.
I noticed this happening when we got someone new on the project. After sitting with a developer I observed that they weren’t using the correct URL to clone and push to the repository; which resulted in duplicate repository representations in the Gitblit UI. You might see “devteamrepo” and “devteamrepo.git” — same repo but reported as two different ones. Generally you check out th e.git repo, but in Gitblit is lists without the suffix. Note that Gitblit needs to use bare repositories, which can probably create a confusion for people typing the URL.
In short — it seems trying to push with an incorrect URL or incorrect permissions can cause this duplication.
If you look at the actual link for the repo in Gitblit, you need to use something like this (found int .git/config — this is correct):
[remote “origin”]
url = http://<userId>@<server>:<port>/r/devteamrepo.git
A lot of times people leave the /r out — which can create a clone-only situation so be careful.
I dug some in the Gitblit boards and found two issues that suggested when a person accesses Gitblit incorrectly, another cache is created which creates this situation. Here are the relevant entries:
Issue 140: Duplicated entries in the web repository listing.
The solution is to log in as an admin, go to repositories and click “clear cache.” That fixes it.
Not sure of any other implications for this solution yet, but am keeping my eye on it.
fedora, git, gitblit, linux