{"id":1161,"date":"2014-07-10T07:40:06","date_gmt":"2014-07-10T14:40:06","guid":{"rendered":"http:\/\/10kdev.net\/?p=1161"},"modified":"2014-09-09T10:22:10","modified_gmt":"2014-09-09T17:22:10","slug":"gitblit-duplicate-repo-bug","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=1161","title":{"rendered":"Gitblit Duplicate Repo Bug"},"content":{"rendered":"<p style=\"text-align: center;\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/07\/aa4078f21ed7a6eb5405d625dfac9c57.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/07\/aa4078f21ed7a6eb5405d625dfac9c57.png\" alt=\"\" width=\"488\" height=\"207\" \/><\/a><\/p>\n<p><em>Logging this because it was kind of difficult to track down.<\/em><\/p>\n<p>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.<\/p>\n<p>But one of the <em><strong>problems<\/strong> <\/em>we have been having is that duplicate names for the same repository show up in Gitblit on occasion. The code doesn&#8217;t seem to be affected; needless to say it&#8217;s annoying.<\/p>\n<p>I noticed this happening when we got someone new on the project. After sitting with a developer I observed that they weren&#8217;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 &#8220;devteamrepo&#8221; and &#8220;devteamrepo.git&#8221; &#8212; same repo but reported as two different ones. Generally you check out th e.git repo, but in Gitblit is lists without the suffix. \u00a0Note that Gitblit needs to use <a href=\"http:\/\/bitflop.com\/document\/111\">bare repositories<\/a>, which can probably create a confusion for people typing the URL.<\/p>\n<p>In short &#8212; it seems trying to push with an incorrect URL or incorrect permissions can cause this duplication.<\/p>\n<p>If you look at the actual link for the repo in Gitblit, you need to use something like this (found int .git\/config &#8212; this is correct):<\/p>\n<p style=\"padding-left: 30px;\">[remote &#8220;origin&#8221;]<br \/>\nurl = http:\/\/&lt;userId&gt;@&lt;server&gt;:&lt;port&gt;\/r\/devteamrepo.git<\/p>\n<p>A lot of times people leave the \/r out &#8212; which can create a clone-only situation so be careful.<\/p>\n<p>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:<\/p>\n<p><a href=\"https:\/\/code.google.com\/p\/gitblit\/issues\/detail?id=150\">Issue 150: Authentication failures create duplicate repository listings for Authenticated Push repos.<\/a><\/p>\n<p><a href=\"https:\/\/code.google.com\/p\/gitblit\/issues\/detail?id=140\">Issue 140: Duplicated entries in the web repository listing.<\/a><\/p>\n<p>The solution is to log in as an admin, go to repositories and click &#8220;clear cache.&#8221; That fixes it.<\/p>\n<p style=\"text-align: left;\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/07\/20ac227ed575c8d3e864b940b0177159.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/07\/20ac227ed575c8d3e864b940b0177159.png\" alt=\"\" width=\"455\" height=\"196\" \/><\/a><\/p>\n<p>Not sure of any other implications for this solution yet, but am keeping my eye on it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[48,35,43,49],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1161"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1161"}],"version-history":[{"count":5,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1161\/revisions"}],"predecessor-version":[{"id":1206,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1161\/revisions\/1206"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1161"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}