Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore /folder vs folder/

Tags:

git

gitignore

in .gitignore what is the difference between using

/bin

and

bin/

And how would I make it so that it removes a certain file, no matter where it is?

*/*.ext
like image 704
JavaIsGreat Avatar asked May 02 '11 19:05

JavaIsGreat


People also ask

Is Gitignore a file or folder?

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 .

Can you Gitignore a folder?

gitignore , you can tell Git to ignore only a single file or a single folder by mentioning the name or pattern of that specific file or folder. You can also tell Git to ignore multiple files or folders using the same method.

What folder does Gitignore go in?

gitignore file tells Git which files to ignore when committing your project to the GitHub repository. gitignore is located in the root directory of your repo. / will ignore directories with the name.

Does Gitignore work in subfolders?

gitignore file is usually placed in the repository's root directory. However, you can create multiple . gitignore files in different subdirectories in your repository.


1 Answers

I tested the cases and also some more ones and here you can review the results:

Results

EDIT: Corrected according to @Dan Breen's comment below (thanks!)

like image 92
Bronek Avatar answered Oct 26 '22 14:10

Bronek