You must have been told how to rename files/folders under GIT.
git mv
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
localhost:case-test sskaje$ touch bbb localhost:case-test sskaje$ git add bbb localhost:case-test sskaje$ git commit -m "bbb" [master 701aca0] bbb 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 bbb localhost:case-test sskaje$ ll total 0 drwxr-xr-x 3 sskaje staff 102 Dec 3 16:32 AAA -rw-r--r-- 1 sskaje staff 0 Dec 3 16:34 bbb localhost:case-test sskaje$ git mv bbb ccc localhost:case-test sskaje$ git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) renamed: bbb -> ccc localhost:case-test sskaje$ git commit -m "rename bbb 2 ccc" [master 1519a8e] rename bbb 2 ccc 1 file changed, 0 insertions(+), 0 deletions(-) rename bbb => ccc (100%) |
And, you may also know that OS X uses case-INsensitive file system by default.
So, How to rename a folder named AAA to aaa ?
Let’s try git mv
1 2 |
localhost:case-test sskaje$ git mv AAA aaa fatal: renaming 'AAA' failed: Invalid argument |
git mv –force
1 2 |
localhost:case-test sskaje$ git mv --force AAA aaa fatal: renaming 'AAA' failed: Invalid argument |
Why?
Because AAA and aaa are ONE SAME folder/file on case-insensitive file systems, move AAA to aaa means move AAA as aaa/AAA.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
localhost:case-test sskaje$ git mv AAA aaa.1 localhost:case-test sskaje$ git mv aaa.1 aaa localhost:case-test sskaje$ git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) renamed: AAA/1 -> aaa/1 localhost:case-test sskaje$ git commit -m "AAA->aaa" [master 9fa8c01] AAA->aaa 1 file changed, 0 insertions(+), 0 deletions(-) rename {AAA => aaa}/1 (100%) |
GIT Rename Folder Name on Case-Insensitive OS by @sskaje: https://sskaje.me/2015/12/git-rename-folder-case-insensitive-os/
Incoming search terms:
Link to this post!