diff --git a/templates/repo/code/fork_sync_message.tmpl b/templates/repo/code/fork_sync_message.tmpl
new file mode 100644
index 0000000000..7edbaa8d4b
--- /dev/null
+++ b/templates/repo/code/fork_sync_message.tmpl
@@ -0,0 +1,10 @@
+{{if .CanSyncFork}}
+
+
+ {{ctx.Locale.TrN .ForkCommitsBehind "repo.sync_fork.branch_behind_one" "repo.sync_fork.branch_behind_few" .ForkCommitsBehind (printf "
%s:%s" .BaseBranchLink .Repository.BaseRepo.FullName .BranchName | SafeHTML)}}
+
+
+ {{ctx.Locale.Tr "repo.sync_fork.button"}}
+
+
+{{end}}
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 318630dfbd..39d0c6c751 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -3,7 +3,6 @@
{{template "repo/header" .}}
{{template "base/alert" .}}
- {{template "repo/code/recently_pushed_new_branches" .}}
{{if and (not .HideRepoInfo) (not .IsBlame)}}
- {{if .CanSyncFork}}
-
-
- {{ctx.Locale.TrN .ForkCommitsBehind "repo.sync_fork.branch_behind_one" "repo.sync_fork.branch_behind_few" .ForkCommitsBehind (printf "
%s:%s" .BaseBranchLink .Repository.BaseRepo.FullName .BranchName | SafeHTML)}}
-
-
- {{ctx.Locale.Tr "repo.sync_fork.button"}}
-
-
- {{end}}
+ {{template "repo/code/recently_pushed_new_branches" .}}
+ {{template "repo/code/fork_sync_message" .}}
{{if .IsViewFile}}
{{template "repo/view_file" .}}