The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,723 other followers

When “git mv” on a directory gives you en error starting with “fatal: bad source”

Posted by jpluimers on 2016/08/23

I use “git mv” a lot because somehow it works a lot better than having git automagically find out about renames.

The problem with “git mv” is that the “fatal: bad source” errors are a catch-all for many causes. Just look at the

Searching for “git mv” directory “fatal: bad source” didn’t get me much further. The one link that did get me towards the right track is version control – Getting Git to follow renamed and edited files – Stack Overflow.

What happened was that I had manually deleted and edited some files as part of a mass script (the repository had a lot of files in it that didn’t belong there compile targets and user specific settings or didn’t adhere to the naming conventions) before executing the “git mv”.

Since “git mv” tries to administer all the files that it thinks originally were in the directory, it complains about those files.

Lesson learned: first “git mv” then perform other changes.

–jeroen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: