I'm using gitbash as my main console on windows. Often I want to copy in a filename from explorer and use it for git commands, this often doesn't work as git sometimes expects filenames in the form /c/directory/directory/filename rather than c:\directory\directory\filename.
I usually have to go in an manually edit the filename/path to be in the correct format, which is anoying if the file is many directories deep.
I've written a sed command to modify the string to be of the correct format:
sed 's:\\:/:g' | sed 's:\(.\)::/\1:g'
Is there a way I can make this a function or something so that I can do something like...
git add convert("c:\blah\blah\myfile.txt")
and what actually gets run is
git add /c/blah/blah/myfile.txt