標籤:
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解決掉了。
| 12345678910111213141516 |
$ git rm code/library/BuildTag*.php; git statusOn branch devChanges 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 statusOn branch devChanges 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 |
http://blog.hexu.org/archives/1909.shtml
如何配置Git支援大小寫敏感和修改檔案名稱中大小寫字母呢?(轉)