您的位置:首页 > 其它

git修改文件名大小写敏感问题解决

2016-07-28 15:20 393 查看
. 在新建代码文件时,不注意把文件名应该小小写搞错了

2. 文件已经push到远程了

3. 在windows下面将文件名字改为全小写

改好后,在Git中没有任何反应,使用git status时,如果遇到下面情况,说明GIT大小写不敏感,如下:
[rock@ROCK-PC]$ /d/WampServer/www/hexu.org/code (dev)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean


如何解决Git的大小不敏感问题呢?

1. 方案一是设置Git大小写敏感:
$ git config core.ignorecase false


2. 方案二是先删除文件,再添加进去:
$ git rm ; git add  ;  git commit -m "rename file"


由于我是与大家共用的仓库,所以我采用的方案2解决掉了。
$ git rm code/library/BuildTag*.php; git status
On branch dev
Changes to be committed:
(use "git reset HEAD ..." to unstage)

deleted:    code/library/BuildTagAfc.php
deleted:    code/library/BuildTagAfs.php

rock@ROCK-PC /d/WampServer/www/hexu.org/code (dev)
$ git add code/library/BuildTag*.php; git status
On branch dev
Changes to be committed:
(use "git reset HEAD ..." to unstage)

renamed:    code/library/BuildTagAfc.php -> code/library/BuildTagafc.php
renamed:    code/library/BuildTagAfs.php -> code/library/BuildTagafs.php
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git