How can I write to .gitignore:
to ignore only images ( .jpg, .jpeg, .png, .gif )
to ignore everything except videos ( .mp4, .flv etc )
using a single command each time?
printf '*.jpg\n*.jpeg\n*.png\n*.gif\n' >> .gitignore
See How do I tell Git to ignore everything except a subdirectory?
printf '*\n!*.mp4\n!*.flv\n' >> .gitignore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With