Here is an excerpt from .gitignore when you created the Next.js project.
#next.js
has /
at the end of the directory, while #production
has /
at the end.
What is the difference?Also, is the presence or absence of /
at the end of this not limited to .gitignore, but is it a general description?
example:
#next.js
/.next/
/out/
# production
/build
When specifying a directory, the ending /
has a special meaning.
(Not only .gitignore, but also rsync commands are often treated the same way.)
reference:
How to write .gitignore.Exclude Files/Directories
If you want to exclude all files under the directory from being tracked, place a "/(slash)" at the end.
The ending // 」 signifies なexclusion of directories and their subordinates その with special meaning, and even if a file with the same name exists, it will not be matched.
If there is no slash, it is normal pattern matching and if a match is found in the path, it is excluded.
© 2024 OneMinuteCode. All rights reserved.