what is .gitignore

11 months ago 21
Nature

A .gitignore file is a text file that tells Git which files or folders to ignore in a project. It is usually placed in the root directory of a project and can be used to ensure that certain files not tracked by Git remain untracked. Files already tracked by Git are not affected by the .gitignore file. Each line in a .gitignore file specifies a pattern, and the entries in this file can follow a matching pattern. To create a local .gitignore file, create a text file and name it .gitignore (remember to include the . at the beginning), then edit this file as needed. To add or change your global .gitignore file, run the following command: git config --global core.excludesfile ~/.gitignore_global. The .gitignore file can be used to ignore files such as temporary files, compilation products, and files generated as part of the project build.