I'm trying to place into git's history successive snapshots of a specific project. I am doing this by populating the repository directory with the contents of each snapshot and then running
git add -A .
git commit -m 'Version X'
This is the method recommended in this answer. However, I see that the commit recognizes file renames only when 100% of the file contents remain the same. Is there a way to influence rename detection of git commit
to make it find renames where the file contents have changed a bit? I see that git merge
and git diff
have various options for controlling the rename threshold, but these options do not exist for git commit
.
Things I have tried:
- Locating the renamed files with a home-brew script, and performing a commit with the original files renamed to their new locations before committing the new file contents. However, this introduces an artificial commit, and seems inelegant, because it doesn't use git's rename detection functionality.
Creating a separate branch for each snapshot and then merging the successive branches onto
master
usinggit merge -s recursive -Xtheirs -Xpatience -Xrename-threshold=20
However, this left me with the renamed files of the old version in place, while also failing to detect the renames.