您的位置:首页 > 其它

如何配置Git支持大小写敏感和修改文件名中大小写字母呢?

2016-10-08 21:42 302 查看
1. 在新建代码文件时,不注意把文件名应该小小写搞错了

2. 文件已经push到远程了

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

改好后,在Git中没有任何反应,使用git status时,如果遇到下面情况,说明GIT大小写不敏感,如下:

123456[rock@ROCK-PC]$ /d/WampServer/www/hexu.org/code (dev)$ git statusOn branch masterYour branch is up-to-date with 'origin/master'. nothing to commit, working directory clean
如何解决Git的大小不敏感问题呢?
1. 方案一是设置Git大小写敏感:

1

$
git
config
core.ignorecase
false

2. 方案二是先删除文件,再添加进去:

1$ git rm ; git add  ;  git commit -m "rename file"
由于我是与大家共用的仓库,所以我采用的方案2解决掉了。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

$
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

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: