diff --git a/app/models/site/index.rb b/app/models/site/index.rb
index cfa4030a..1e256a9e 100644
--- a/app/models/site/index.rb
+++ b/app/models/site/index.rb
@@ -46,11 +46,19 @@ class Site
 
       private
 
-      # Trae el último commit indexado desde el repositorio
+      # Trae el último commit indexado desde el repositorio, o si no
+      # existe, trae el primer commit.
       #
       # @return [Rugged::Commit]
       def indexed_commit
-        @indexed_commit ||= repository.rugged.lookup(last_indexed_commit)
+        @indexed_commit ||=
+          if repository.rugged.exists?(last_indexed_commit)
+            repository.rugged.lookup(last_indexed_commit)
+          else
+            repository.rugged.lookup(
+              repository.rugged.references[repository.rugged.head.canonical_name].log.first[:id_new]
+            )
+          end
       end
 
       # Calcula la diferencia entre el último commit indexado y el