Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

git
github

How to add folder to gitignore

Educative Answers Team

In Git, you can use the gitignore file to specify untracked files that Git should ignore.

Each line in a gitignore file specifies a pattern.

In this shot, we will see how you can ignore an entire folder/directory.

svg viewer

Usage

Create a file called .gitignore in your project’s directory. In case you already have it, skip this step.

To add a folder/directory to .gitignore, include their paths and put a / at the end:

folder_to_ignore/

Note: .gitignore ignores untracked files. Files already tracked by Git are not affected. To stop tracking a file that is currently tracked, use git rm --cached.

RELATED TAGS

git
github
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring