1

I have a repo on Linux A pushing to GitHub and then that is pulled to another Linux B.

I have changed *.dat to text in .gitattributes. and pushed and pulled it to Linux B.

On Linux B git status reports all .dat files are modified.

On Linux B I do a git reset --hard HEAD

Linux B git status still reports all .dat files are modified

Now if I push a change from Linux A to GitHub, the Linux B pull reports "error: Your local changes to the following files would be overwritten by merge" Files listed are all the .dat files.

git diff lists every line changed, yet its a Unix format file and the repo stores Unix format file.

Any ideas?

RobG
  • 744
  • 6
  • 16
  • I would have thought that after a hard reset on Linux B that you should have synced repositories. Perhaps try a `git clean -fdx` and if that still does not help, re-normalise the Linux B repository (this [link](https://help.github.com/articles/dealing-with-line-endings#re-normalizing-a-repository) might help) – miqh Nov 05 '13 at 06:03
  • When I committed the changes to the repo it reported changing line endings from CRLF to LF. I surmise that as a binary file, CRLF was put in the repo. I then changed its storage type and so LF was expected in the repo, but as it was CRLF, modifications were reported. Can anybody confirm? – RobG Nov 06 '13 at 21:57
  • @miqid - I only just noticed your comment. The re-normalise would have addressed the issue. Thanks. – RobG Nov 06 '13 at 22:01

1 Answers1

2

Changing an attribute, and committing/pushing the .gitattributes file isn't enough.

You need to add, commit and push the files impacted by your modification, as in this answer.

If you don't have any work in progress:

git rm --cached -r .
git reset --hard
git add .
git commit -m " *.dat are now text"
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250