I need to make one correction about your description of the way git works. When you do a git add foo, the state of the file foo at that point becomes staged. If you later change foo those changes will not be in the staged version unless you do another git add foo. When you finally do a git commit, the file foo that gets committed will be in the state it was in when the most recent git add foo command was issued.
I need to make one correction about your description of the way git works. When you do a git add foo, the state of the file foo at that point becomes staged. If you later change foo those changes will not be in the staged version unless you do another git add foo. When you finally do a git commit, the file foo that gets committed will be in the state it was in when the most recent git add foo command was issued.