Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to rename a file in Git

Tags:

git

I want to rename SystemDBContext.cs to SystemDbContext.cs and when I try renaming the file like this:

git mv SystemDBContext.cs SystemDbContext.cs

I get the following error:

fatal: destination exists, source=BabyChangeFinder/DataAccess/SystemDBContext.cs, destination=BabyChangeFinder/DataAccess/SystemDbContext.cs

I checked the directory; the destination definitely doesn't exist:

$ ls
SystemDBContext.cs

Anyone know what's going on here?

like image 963
NRKirby Avatar asked Apr 19 '15 09:04

NRKirby


1 Answers

Try

git mv --force SystemDBContext.cs SystemDbContext.cs

or

git mv -f SystemDBContext.cs SystemDbContext.cs

like image 67
Vaibhav Mule Avatar answered Oct 07 '22 05:10

Vaibhav Mule