Lecture # 14 - Gitignore

Lecture # 14 - Gitignore

Understanding .gitignore file

Gitignore:

The .gitignore file is a text file used by Git to specify intentionally untracked files that Git should ignore. These files are typically generated as part of the build process, contain sensitive information, or are specific to a developer's local environment. The .gitignore file helps prevent these files from being accidentally committed to the Git repository. Follow the steps to use the .gitignore file:

  • List the contents of the directory.

  • Create a .gitignore file and include the files/folders that you want to ignore.

  • Stage the files. You'll see that the file we included in the .gitignore file is not staged.

  • Commit the changes.

  • Push the changes to remote.

  • Check the remote repository.