I have a local branch with several commits. Now I need to rewrite all these commits and change the file name, but only in one specific directory. I donβt want any changes to be made outside my local branch.
Running git filter-branch 'some command' master..HEAD in this directory gives me
You need to run this command from the toplevel of the working tree.
Of course, I can run this from the top level, but it will force me to write my script with the outline of the directory that I really want to change, and in the end I would like to run the same script in a couple of directories, not knowing that there is a full path.
Is there a way to start the filter branch and have the script have the current directory as a working directory?
source share