I am trying to rename a large number of incorrectly named files, which are tracked in my local git repo. The files are currently of the form foo.txt_1.txt. And I want to change them to foo.txt.
This is what I have been experimenting with so far:
ls *_1.txt | xargs -I {} git mv -n {} newfilename
I'm just not sure what I should use in place if newfilename to make the substitution I want.