What is Git Ignore and How to Create Git Ignore

Bharathiraja
CodeX
Published in
2 min readJul 7, 2022

--

No need to push unwanted files or folders to Github. You can exclude files and folders using the gitignore.

Gitignore File

Github is a very popular cloud version control system(VCS) that uses Git. Developers are recommended to use VCS for every project. Github helps you to track who made the changes and what is changed. You can easily roll back to the previous code if the current code causes any error. Github offers both public and private repositories to store the code. This tutorial focuses on what is gitignore and how to create a gitignore file.

What is gitignore?

When working with the project, you may need some files or folders. For example the node_modules folder in the Angular project. But you do not require those files or folders to be pushed to the Github repo. If you do not want to push the specific files or folders then you need a gitignore file. The git push command reads the gitignore file and ignores the files and folders mentioned in the repo before pushing them.

In simple terms, if you want to exclude files and folders when pushing to Github, then gitignore is used to mention which files and folders need to be excluded.

How to Create Git

--

--

Bharathiraja
CodeX
Writer for

AWS | DevOps | Kubernetes | Terraform| Angular | Deep&Machine Learning, Ionic, Full Stack Developer. Learn more at https://github.com/bharathirajatut