DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

Juggling git branches

Anyone had this kind of experience? Juggling between git branches, where ignored (and included) files are different.

The answer is indeed git-clean; however, I have just learned that I can add -e <FILENAME>.

git clean -xdn -e .env
git clean -xdn -e .env [...[-e <ADDITIONAL_FILES>]]
# finally
git clean -xdf -e .env [...[-e <ADDITIONAL_FILES>]]
Enter fullscreen mode Exit fullscreen mode

Additional files can include wildcards, and if start from the root directory, prefix with /.

Top comments (0)