Say we go for a sample run:
git init
echo -e 'hede\nhodo' > new.txt
git add new.txt
git commit -m 'commit 1'
1 file changed, 2 insertions(+)
echo -e 'hede\n123' > new.txt
git add new.txt
git commit -m 'commit 2'
1 file changed, 1 insertion(+), 1 deletion(-)
So I know SHA of two versions. When I look into them, I see:
git cat-file -p ad0daa422be9531700a069e6800b18c065f755bb
hede
hodo
git cat-file -p 6fbf5b80b76bbe270bb41789c34851d622ae1f63
hede
123
It seems git copied blob, but 'hede' remained redundant. I know it is not a big impact for small files but just asking: Does git optimize this into differences later on? Or is this the way what makes git efficient?
Thanks