How to purge&remove forcebly all files a.out & all files with .o in all (sub)directories in a git repo.

In case these files made it somehow into version control, I would execute in a working directory of the repo:
find . -name "a.out" -or -name "*.o" -print0 | xargs -0 git rm

Perhaps you want to do a dry run before, in this case add the directive --dry-run at the end of above command.

Afterwards you execute:
git commit -am "removed all a.out and *.o files from the repo."
git push

In case these files are not under version control, I would execute:
find . -name "a.out" -or -name "*.o" -print0 | xargs -0 rm -v
 
Back
Top