I want to rename my file in my repository locally. So I do:
git mv -f hashpq.py HashPQ.py
And get this:
warning: destination exists; will overwrite!
Then I get the status of git by:
git status
And get thisresponse:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: hashpq.py
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# hashpq.py
But after I list my directory by:
ls
I have this:
CHANGLELOG hashpq.py NEXTPLAN README TODO
I still have hashpq.py unchanged with previous name. How can I rename the file to HashPQ.py?
Try renaming it to some temporary name, and then to the name you want:
git mv hashpq.py _hashpq.py
git mv _hashpq.py HashPQ.py
git commit
This is the same behaviour as the regular mv
command when the file system is case-insensitive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With