Git_ignore

How to use gitignore

1. cd into your projects root directory

2. Create .gitignore file

$ touch .gitignore

3. Write it down using .gitignore patterns

ex)

  • To ignore all files ending in .log

    $ echo '*.log' >> .gitignore
  • To ignore any file names that contain .log

    $ echo '*.log*' >> .gitignore
  • To ignore all files in a specific path

    $ echo 'directory' >> .gitignore
    $ echo '/directory/directory/*' >> .gitignore

Last updated