When merging, ever get the error message: Error: Entry ‘foo’ is notuptodate. Cannot merge. Two possibilities:

  1. You may have local changes that are not committed (so commit them!) or undo those changes.
  2. You may have a file that has been modified, but the contents have not been changed. ie somehow the file was ‘touch’ed. Thus git thinks that the file has been modified because its modification date has changed, but then its hash is still the same because the content hasn’t changed, so I guess it gets confused. Doing this command below updates the file stats for your repo index to flush out this second possibility:
git update-index --refresh