我有一个项目,其中包含无法更新的某些 js 文件。我在本地运行 OSX,我的远程/登台服务器是 Linux (CentOS)。
在本地克隆我的项目后,我注意到所有这些文件都带有 git status modified
。我从未修改过它们,所以我尝试过修改它们discard changes
,reset
但它们又出现了。修改中的更改是删除所有行并再次添加它们。
我不确定为什么会发生这种情况或如何修复它,以便我的 git 状态按照需要保持干净。
以下是 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
更新 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.
...