diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl
index f5fc27315a..8652a72052 100644
--- a/templates/repo/graph/commits.tmpl
+++ b/templates/repo/graph/commits.tmpl
@@ -31,27 +31,27 @@
{{RenderCommitMessage $.Context $commit.Subject $.RepoLink $.Repository.ComposeMetas}}
-
+
{{range $commit.Refs}}
{{$refGroup := .RefGroup}}
{{if eq $refGroup "pull"}}
{{if or (not $.HidePRRefs) (SliceUtils.Contains $.SelectedBranches .Name)}}
-
- {{svg "octicon-git-pull-request" 16 "gt-mr-2"}}#{{.ShortName}}
+
+ {{svg "octicon-git-pull-request"}} #{{.ShortName}}
{{end}}
{{else if eq $refGroup "tags"}}
-
- {{svg "octicon-tag" 16 "gt-mr-2"}}{{.ShortName}}
+
+ {{svg "octicon-tag"}} {{.ShortName}}
{{else if eq $refGroup "remotes"}}
-
- {{svg "octicon-cross-reference" 16 "gt-mr-2"}}{{.ShortName}}
+
+ {{svg "octicon-cross-reference"}} {{.ShortName}}
{{else if eq $refGroup "heads"}}
-
- {{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.ShortName}}
+
+ {{svg "octicon-git-branch"}} {{.ShortName}}
{{else}}
diff --git a/web_src/css/features/gitgraph.css b/web_src/css/features/gitgraph.css
index 0ca611d641..a49e930948 100644
--- a/web_src/css/features/gitgraph.css
+++ b/web_src/css/features/gitgraph.css
@@ -109,8 +109,13 @@
background-color: var(--color-secondary-alpha-30);
}
-#git-graph-container #rev-list .tags a.button {
+#git-graph-container #rev-list .commit-refs .button {
padding: 2px 4px;
+ margin-right: 0.25em;
+ display: inline-block;
+ max-width: 200px;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
#git-graph-container #rev-list .sha.label {