While working on another file, I edited README.md
and then ran git add README.md
. When doing a git commit, I see that README.md
is both i
Answer to "Does this make sense?"
It only makes sense if you understand that git does not store differences it stores snapshots.
In the example you describe there are two versions of README.md in your changes. The staged one is the version that you're currently happy with and will end up being the latest snapshot of the file if you choose to commit it. The unstaged version is is a potential snapshot that will replace the currently staged version if you choose to stage it.
Read the section 'Snapshots, Not Differences' in the following link for more understanding on how git works:
http://git-scm.com/book/en/Getting-Started-Git-Basics
Also look at the following link for a further explanation of the scenario that you've included in your question (in particular the section 'Staging Modified Files'):
http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository