Skip to content
eviweb edited this page Mar 23, 2021 · 4 revisions

Create a .gitignore file

git ignore create [-f] [-g] [-d <directory>] [<pattern1>,<pattern2>,...]

In its simplest form, it creates an empty .gitignore file in the current directory.

Available options

  • -f flag : force the replacement of an existing .gitignore file
  • -g flag : create a global .gitignore file by running git config --global core.excludesfile <file>
  • -d <directory> : specify the target directory in which create the file

List of patterns

you can specify a comma separated list of patterns to include in the generated file.
The pattern names are the ones displayed by the git ignore list command.

Be aware that pattern names are case sensitive

Clone this wiki locally