diff --git a/cmd/web.go b/cmd/web.go
index da392a1e9..3fc39628b 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -514,11 +514,11 @@ func runWeb(ctx *cli.Context) {
 			m.Get("/edit/:tagname", repo.EditRelease)
 			m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
 			m.Post("/delete", repo.DeleteRelease)
-		}, reqRepoAdmin, middleware.RepoRef())
+		}, reqRepoAdmin)
 
 		m.Combo("/compare/*").Get(repo.CompareAndPullRequest).
 			Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)
-	}, reqSignIn, middleware.RepoAssignment())
+	}, reqSignIn, middleware.RepoAssignment(), middleware.RepoRef())
 
 	m.Group("/:username/:reponame", func() {
 		m.Group("", func() {
diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl
index 03a07935c..07762606f 100644
--- a/templates/repo/commits.tmpl
+++ b/templates/repo/commits.tmpl
@@ -1,7 +1,6 @@
 {{template "base/head" .}}
 
   {{template "repo/header" .}}
-  {{template "repo/sidebar" .}}
   
     {{template "repo/commits_table" .}}
   
diff --git a/templates/repo/forks.tmpl b/templates/repo/forks.tmpl
index f541cd0a8..91085b9d2 100644
--- a/templates/repo/forks.tmpl
+++ b/templates/repo/forks.tmpl
@@ -1,7 +1,6 @@
 {{template "base/head" .}}
 
   {{template "repo/header" .}}
-  {{template "repo/sidebar" .}}
   
     
 
 {{end}}
+{{if not .IsBareRepo}}
+
+  
+
+
+{{else}}
+
+{{end}}
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 85094104b..b733583b0 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -1,7 +1,6 @@
 {{template "base/head" .}}
 
   {{template "repo/header" .}}
-  {{template "repo/sidebar" .}}
   
     
       {{if .Repository.DescriptionHtml}}{{.Repository.DescriptionHtml}}{{else}}{{.i18n.Tr "repo.no_desc"}}{{end}}
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl
index f955973c6..dd84ce416 100644
--- a/templates/repo/issue/labels.tmpl
+++ b/templates/repo/issue/labels.tmpl
@@ -1,7 +1,6 @@
 {{template "base/head" .}}
 
 	{{template "repo/header" .}}
-	{{template "repo/sidebar" .}}
 	
 		
 			{{template "repo/issue/navbar" .}}
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index b927d8006..5b1ad1d02 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -1,7 +1,6 @@
 {{template "base/head" .}}
 
 	{{template "repo/header" .}}
-	{{template "repo/sidebar" .}}
 	
 		
 			{{template "repo/issue/navbar" .}}
diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl
index 527a90b4d..248b81e24 100644
--- a/templates/repo/issue/milestones.tmpl
+++ b/templates/repo/issue/milestones.tmpl
@@ -1,7 +1,6 @@
 {{template "base/head" .}}
 
 	{{template "repo/header" .}}
-	{{template "repo/sidebar" .}}
 	
 		
 			{{template "repo/issue/navbar" .}}
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index 5c3aaae7f..5970bda3d 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -1,7 +1,6 @@
 {{template "base/head" .}}
 
   {{template "repo/header" .}}
-  {{template "repo/sidebar" .}}
   
     {{template "base/alert" .}}