diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py
index a3f335d1247caabd14fc2dde64a6c5a36edfa3fc_aGdleHQvY29udmVydC9fX2luaXRfXy5weQ==..ea3540e66fd83ee6564064b02171c3732d181c72_aGdleHQvY29udmVydC9fX2luaXRfXy5weQ== 100644
--- a/hgext/convert/__init__.py
+++ b/hgext/convert/__init__.py
@@ -320,6 +320,13 @@
         is very expensive for large projects, and is only effective when
         ``convert.git.similarity`` is greater than 0. The default is False.
 
+    :convert.git.renamelimit: perform rename and copy detection up to this
+        many changed files in a commit. Increasing this will make rename
+        and copy detection more accurate but will significantly slow down
+        computation on large projects. The option is only relevant if
+        ``convert.git.similarity`` is greater than 0. The default is
+        ``400``.
+
     :convert.git.remoteprefix: remote refs are converted as bookmarks with
         ``convert.git.remoteprefix`` as a prefix followed by a /. The default
         is 'remote'.
diff --git a/hgext/convert/git.py b/hgext/convert/git.py
index a3f335d1247caabd14fc2dde64a6c5a36edfa3fc_aGdleHQvY29udmVydC9naXQucHk=..ea3540e66fd83ee6564064b02171c3732d181c72_aGdleHQvY29udmVydC9naXQucHk= 100644
--- a/hgext/convert/git.py
+++ b/hgext/convert/git.py
@@ -78,6 +78,10 @@
                                              False)
             if findcopiesharder:
                 self.simopt.append('--find-copies-harder')
+
+            renamelimit = ui.configint('convert', 'git.renamelimit',
+                                       default=400)
+            self.simopt.append('-l%d' % renamelimit)
         else:
             self.simopt = []
 
diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
index a3f335d1247caabd14fc2dde64a6c5a36edfa3fc_dGVzdHMvdGVzdC1jb252ZXJ0LWdpdC50..ea3540e66fd83ee6564064b02171c3732d181c72_dGVzdHMvdGVzdC1jb252ZXJ0LWdpdC50 100644
--- a/tests/test-convert-git.t
+++ b/tests/test-convert-git.t
@@ -374,6 +374,31 @@
   A bar-copied2
     bar
 
+renamelimit config option works
+
+  $ cd git-repo2
+  $ cp bar bar-copy0
+  $ echo 0 >> bar-copy0
+  $ cp bar bar-copy1
+  $ echo 1 >> bar-copy1
+  $ git add bar-copy0 bar-copy1
+  $ commit -a -m 'copy bar 2 times'
+  $ cd ..
+
+  $ hg -q convert --config convert.git.renamelimit=1 \
+  > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo2
+  $ hg -R fullrepo2 status -C --change master
+  A bar-copy0
+  A bar-copy1
+
+  $ hg -q convert --config convert.git.renamelimit=100 \
+  > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo3
+  $ hg -R fullrepo3 status -C --change master
+  A bar-copy0
+    bar
+  A bar-copy1
+    bar
+
 test binary conversion (issue1359)
 
   $ count=19
diff --git a/tests/test-convert.t b/tests/test-convert.t
index a3f335d1247caabd14fc2dde64a6c5a36edfa3fc_dGVzdHMvdGVzdC1jb252ZXJ0LnQ=..ea3540e66fd83ee6564064b02171c3732d181c72_dGVzdHMvdGVzdC1jb252ZXJ0LnQ= 100644
--- a/tests/test-convert.t
+++ b/tests/test-convert.t
@@ -261,6 +261,13 @@
                     for large projects, and is only effective when
                     "convert.git.similarity" is greater than 0. The default is
                     False.
+      convert.git.renamelimit
+                    perform rename and copy detection up to this many changed
+                    files in a commit. Increasing this will make rename and copy
+                    detection more accurate but will significantly slow down
+                    computation on large projects. The option is only relevant
+                    if "convert.git.similarity" is greater than 0. The default
+                    is "400".
       convert.git.remoteprefix
                     remote refs are converted as bookmarks with
                     "convert.git.remoteprefix" as a prefix followed by a /. The