博文記錄
教程分享 2020-08-11 03:00:59 376 0

今天通过 git 更新代码到服务器时,遇到了一个文件被修改的提示,之前也遇到过很多次,可一直并没有解决掉。

# git pull origin master
Warning: Permanently added the ECDSA host key for IP address '212.x.x.x' to the list of known hosts.
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 4), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
From xxx.com:xxxx
 * branch            master     -> FETCH_HEAD
Updating a67c80e..46bb84d
error: Your local changes to the following files would be overwritten by merge:
	public/ckeditor/contents.css
Please, commit your changes or stash them before you can merge.
Aborting

因为基本没有在服务器上直接修改过这个文件,所以很好奇到底变动了哪些内容。

# git diff public/ckeditor/contents.css
diff --git a/public/ckeditor/contents.css b/public/ckeditor/contents.css
old mode 100644
new mode 100755

果不其然是权限的变动,在网上也搜索到了别人的解决办法,在此记录一下,一般我们只关心文件内容的变动,则可以通过如下命令忽略权限的变动

git config --add core.filemode false
索引目录
media iamge
StudioEIM - 冒险者讲习所
0:00