I have a visual studio solution with a few asp.net 5 project. Inside every project I have a wwwroot directory and inside this an app directory that contains the html views, .js and .map files that are typescript files compiled in this position.
With the standard configuration these files are included in the checkin. How can configure the .gitignore file so all the .js and .map files, inside every subdir of the wwwroot\app directory of every project in the solution are ignored?
Open the . git/info/exclude file in a text editor and add the folder to ignore. This file remains private to you.
A . gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Generally, this is placed in the root folder of the repository, and that's what I recommend. However, you can put it in any folder in the repository and you can also have multiple .
gitignore file is a text file that tells Git which files or folders to ignore in a project. A local . gitignore file is usually placed in the root directory of a project. You can also create a global . gitignore file and any entries in that file will be ignored in all of your Git repositories.
wwwroot/app/**/*.js wwwroot/app/**/*.map
The **
will match everything inside app
, also multiple levels of subdirectories.
Add the following lines to your .gitignore:
# Ignores compiled TypeScript files **/wwwroot/app/**/*.map **/wwwroot/app/**/*.js
You can read more about gitignore and supported patterns here.
**
matches subdirectories recursively. The first one is there for the projects, the second one is there because you mentioned
inside every subdir of the wwwroot\app directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With