I have a .gitignore file in my repository top level folder with the following code:
# Compiled python modules.
# Backup gedit files.
# Setuptools distribution folder.
# Python egg metadata, regenerated from source files by setuptools.
git add .
new file: uvispace/tests/test_messenger.py
new file: uvispace/tests/test_messenger.py~
new file: uvispace/tests/test_robot.py~
new file: uvispace/uvirobot/__main__.py~
new file: uvispace/uvirobot/messenger.py~
new file: uvispace/uvirobot/move_base.py
git rm -rf --cached .
git add *
The documentation about the gitignore-syntax can be found here: git-scm.com/docs/gitignore
One thing that probably is wrong is your
/*~ because the single
* doesn't work the way you expect:
For example, "Documentation/*.html" matches "Documentation/git.html" but not "Documentation/ppc/ppc.html" or "tools/perf/Documentation/perf.html".
You have to use
•A leading "
**" followed by a slash means match in all directories. For example, "
**/foo" matches file or directory "
foo" anywhere, the same as pattern "
**/foo/bar" matches file or directory "
bar" anywhere that is directly under directory "
•A trailing "
/**" matches everything inside. For example, "
abc/**" matches all files inside directory "
abc", relative to the location of the .gitignore file, with infinite depth.
•A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, "
a/**/b" matches "
a/x/y/b" and so on.