我有一个包含某些无法更新的js文件的项目。我在本地运行OSX,而我的远程/临时服务器是Linux(CentOS)。
在本地克隆项目后,我立即注意到所有这些文件的状态均为git modified
。我从来没有修改他们,所以我想discard changes
还是reset
他们,但他们再次出现。修改中的更改是删除所有行,然后再次添加它们。
我不确定为什么会发生这种情况或如何解决它,以便我的git状态如所需要的那样干净。
这是git状态的几行:
# 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
更新1:
现在,我已经成功提交了上述文件,但是登台服务器已被锁定,因为它不会拉出新的编辑内容:
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
我无法提交/推送,因为:
Updates were rejected because a pushed branch tip is behind its remote counterpart
我试过了:
git reset --hard
和
git stash
git stash drop
但是它们不起作用,什么也没发生。
更新2:
git diff
给我:
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.
...