What is the primary purpose of the .gitignore file in a Git repository?

  • To track changes in the repository
  • To store repository metadata
  • To list files and directories to be ignored by Git
  • To define repository settings
The correct option is To list files and directories to be ignored by Git. The .gitignore file is used to specify files and directories that Git should ignore, preventing them from being tracked.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *