strong textgit status shows file as modified, however when commiting it shows the file as been copied ie:
git status
modified: foo/bar/baz.xml
git commit
copied: bar/foo/baz.xml -> foo/bar/baz.xml
Why is it showing this file as copied if it was not. The two files were identical before the change.
if two files are the same (or very much the same) git recognizes them as copied.
Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed. Enter git commit -m '<commit_message>' at the command line to commit new files/changes to the local repository.
git commit -a -m "new message" .... commits all changes.
git tracks content, not files. if two files are the same (or very much the same) git recognizes them as copied. there shouldn't be any implications from this
in your case both files were identical (100 %), so git has no possibility to know if the file was copied, or just accidentally happened to be the same.
don't worry, git only stores snapshots of the tree to the repository. you can control copy and rename detection for git log
with parameters -C
and -M
, git will then try harder to find renames/copies
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With