I have a project with certain js files which I cannot update. I run OSX locally and my remote/staging server is Linux (CentOS).
Right after cloning my project locally, i noticed I have all those files with git status modified
. I never modified them, so I tried to discard changes
or reset
them, but they come up again. The change that is in the modification is deleting all lines and adding them again.
I'm not sure why this happens or how to fix it so that my git status is clean as it needs to be.
Here is a few lines from the git status:
# modified: app/webroot/js/ckeditor/plugins/devtools/lang/el.js
# modified: app/webroot/js/ckeditor/plugins/devtools/lang/fa.js
# modified: app/webroot/js/ckeditor/plugins/devtools/lang/gu.js
UPDATE 1:
I have now managed to commit the above files, but the staging server is locked because it won't pull new edits:
error: Your local changes to the following files would be overwritten by merge:
app/webroot/js/ckeditor/_source/lang/ar.js
app/webroot/js/ckeditor/_source/lang/bg.js
app/webroot/js/ckeditor/_source/lang/bn.js
app/webroot/js/ckeditor/_source/lang/cs.js
...
Aborting
I can't commit/push because:
Updates were rejected because a pushed branch tip is behind its remote counterpart
I tried:
git reset --hard
and
git stash
git stash drop
But they don't work, nothing happens.
UPDATE 2:
git diff
gives me:
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in app/webroot/js/ckeditor/_source/lang/fa.js.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in app/webroot/js/ckeditor/_source/lang/gu.js.
The file will have its original line endings in your working directory.
...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…