git ignores specific files or directories

When adding a directory to the git repository or submitting changes to a git repository, you may wish to ignore some files or directories (such as the .o and .a files generated during compilation), and you can modify .git/ Info/exclude file to achieve.

Examples are as follows:

vi .git/info/exclude


# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with'#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
*.[oa] #Ignore files or directories ending in .o or .a
*.pyc        
*.exe #Ignore ending in .exe Files or directories
. * #Ignore files or directories starting with . *.
rar
*.zip
*.gz
*.bz2
*.db
*.sqlite

Guess you like

Origin blog.csdn.net/huzhenwei/article/details/7426093
Recommended