Gitignore – Ignore only images & ignore everything except .. in single command

How can I write to .gitignore:

  1. to ignore only images ( .jpg, .jpeg, .png, .gif )

  2. Eclipse and EGit
  3. Windows custom git commands
  4. How to rewrite history so that all changes made within a folder are removed?
  5. How do you manage to keep credentials out of publically browsable source code?
  6. Remove code from Git in a way that allows to easy bring it back if needed?
  7. GitLab git user password
  8. to ignore everything except videos ( .mp4, .flv etc )

using a single command each time?

  • Diff content changes across renames
  • Can't find git-svn on Mac OS X Leopard after installing via MacPorts
  • Pull says there are changes, stash says there are no changes?
  • Can I add a sibling directory as a git submodule?
  • What steps must I take to consistently push to two Github accounts using SSH?
  • what does using gitflow offer a git user?
  • One Solution collect form web for “Gitignore – Ignore only images & ignore everything except .. in single command”

    1 Ignore images

    printf '*.jpg\n*.jpeg\n*.png\n*.gif\n' >> .gitignore
    

    2 Ignore everything but videos:

    See How do I tell Git to ignore everything except a subdirectory?

    printf '*\n!*.mp4\n!*.flv\n' >> .gitignore
    
    Git Baby is a git and github fan, let's start git clone.