git ignore filenames which contain

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)