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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.