Posted over 8 years ago. Visible to the public.

Git: How to remove ignored files from your repository's directory

When you have files in your .gitignore they won't be considered for changes, but still you might want to get rid of them, e.g. because they clutter your file system.

While a regular git clean will ignore them as well, passing the -x switch changes that:

Copy
git clean -x

If you want to see what would happen first, make sure to pass the -n switch for a dry run:

Copy
git clean -xn

Clean even harder by passing the -f (force cleaning under certain circumstances; I think this is also required by default) or -d (removes directories) switches:

Copy
git clean -xdf

Careful: You may be ignoring local config files like database.yml which would also be removed. Use at your own risk.

Flaky tests are tests that sometimes fail for no obvious reason. They are the plague of many end-to-end (E2E) test suites that automate the browser through tools like Capybara and Selenium.

Join our free training event and learn to fix any flaky test suite, even in large legacy applications.

Owner of this card:

Avatar
Arne Hartherz
Last edit:
over 8 years ago
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more