Ignore modified (but not committed) files in git?

What I usually do is

git stash

git whatever-else

git stash apply

git stash clear

check out the git-update-index man page and the --assume-unchanged bit and related.

when I have your problem I do this

git update-index --assume-unchanged dir-im-removing/

or a specific file

git update-index --assume-unchanged config/database.yml

Use this code

git update-index --assume-unchanged file-name

A newer and better option is git update-index --skip-worktree which won't be lost on a hard reset or a new change from a pull.

See the man page.

And a comparison at http://fallengamer.livejournal.com/93321.html