I am new in Git and I am looking for a way to disable the automatic rename detection during operations like add, rm, commit.
It is mainly for reasons of clarity and maintenance of a computing code. Even if a new file B is quite similar to another existing Git file A at this moment, I would like to record B separately with no history coming from A.
With Git v2.31.1, it seems to work for add/rm operations thanks to the option "renames = 0". The .gitconfig file :
[diff]
tool = tkdiff
renames = 0
[merge]
renames = 0
[difftool]
prompt = false
Here is the situation I would like to avoid.
> cat FileA.txt
This is a first line
Values are 2.D-4 1.D-1 5.D-3
This is the end
> git init
> git add FileA.txt
> git commit -m " Step 1 "
> cat FileB.txt
This is a first line
Values are 1.D-4 4.D-1 9.D-3
This is the end
> git add FileB.txt
> git rm FileA.txt
> git status
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: FileA.txt
new file: FileB.txt
> git commit -m " Step 2 "
[master 4fe24cf] Step 2
1 file changed, 1 insertion(+), 1 deletion(-)
rename FileA.txt => FileB.txt (56%)
> git log --oneline FileB.txt
4fe24cf (HEAD -> master) Step 2
> git log --oneline --follow FileB.txt
4fe24cf (HEAD -> master) Step 2
ccf5076 Step 1
I do not know if git commit relies on git diff to compute similarity indexes, but options used for git diff, like "renames = 0" or "find-renames=100", have no impact here. And I did not find relevant options to test in the Git documentation for the commit command.
How can I proceed ? are there any others options ?