I am trying to tell git to ignore files which have \"_autosave\" somewhere in the filename. An example of such a file is:
hats/TFCB_ATV_TOP_HAT/_autosave-TFCB_ATV_H
Add this line to your .gitignore
*_autosave*
According to git help gitignore
patterns match relative to the location of the .gitignore file
Patternz like *_autosave*
match files or directories containing "_autosave" somewhere in the name.
Two consecutive asterisks ("**") in patterns mathed against full pathname may have special meaning
A leading "**" followed by a slash means match in all directories.
But "**/" seams redundant in some enviroments.
EDIT:
My machine at work (using git 1.7.1) does not have support for dubbel asterisk, but with *_autosave*
it excludes the files.
here is a simple test scrtipt (for Linux)
DIR="$(mktemp -d)"
git init $DIR/project1
cd $DIR/project1
cat > .gitignore <<EOF
**/*_autosave*
*_autosave*
EOF
mkdir dir1
touch README foo_autosave dir1/bar_autosave
git status
rm -rf $DIR/project1