Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude folder from github

Tags:

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

like image 772
Java Afca Avatar asked May 22 '13 13:05

Java Afca


People also ask

How do I tell GitHub to ignore a folder?

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.

How do I skip a folder in Git?

. 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.


2 Answers

  1. Create a file called .gitignore in your repository.
  2. Add the text "App_Data" to this file.
  3. Save.

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

like image 113
MrHappyAsthma Avatar answered Oct 11 '22 10:10

MrHappyAsthma


Simply put this in your .gitignore file (assuming MyProject is your git root):

App_data 
like image 39
Jon Cairns Avatar answered Oct 11 '22 11:10

Jon Cairns