I need to exclude the folder App_Data from my Github but i don't know how.
I have a application which saves many files like jpg files in the directory: Source\MyProject\App_data\stored\filename.jpg
Now i need to exclude this from the .gitignore file
I don't know how to do this so i am looking for a example
If you want to maintain a folder and not the files inside it, just put a ". gitignore" file in the folder with "*" as the content. This file will make Git ignore all content from the repository.
. gitignore is a plain text file in which each line contains a pattern for files or directories to ignore. It uses globbing patterns to match filenames with wildcard characters. If you have files or directories containing a wildcard pattern, you can use a single backslash ( \ ) to escape the character.
It should do exactly what you want. It will exclude files/folders with that string from your local repository path (the path where .gitignore is stored).
Keep in mind, this is not your only option. I'd read the help document linked below for a better understanding to get exactly what you need accomplished.
See here for more info: GitHub Help - Ignoring Files
Simply put this in your .gitignore
file (assuming MyProject is your git root):
App_data
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