Git – Ignore Files To Prevent Commit

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/git-ignore-files-prevent-commit/
PINTEREST
PINTEREST
INSTAGRAM

Git is used for a lot of different projects. These projects may provide different types of files. Some times some of those files should not be committed in to the repository. For example after running a python application pyc files are created as compiled python files. Committing them are unnesecary.

Git Ignore File

To ignore files the patterns should be defined in a files named .gitignore file. .gitignore file by default resides in the root of the repository but can be used in sub directories too.

  • *.pyc means any file ends with pyc extension
  • Each line for one entry

  • # is used as comment and no effect on files those will be ignored

  • /build directory is completely ignored

  • All files in /build directory with extension .out
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/git-ignore-files-prevent-commit/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Git - Reviewing Changes

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)