Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Git ignore these folders?

Tags:

git

git-status

I added a Laravel App under Git so that I could push to Bitbucket. On root folder, I ran git add -A and pushed on remote server. I checked that it did not send all folders; for instance, it did not add vendor folder at all. How do I make sure that all subfolders are added? When I run git status, it says:

# On branch master
nothing to commit, working directory clean

Update

I ran git status --ignore and found the following files listed:

stocktrack/app/storage/logs/laravel.log
stocktrack/app/storage/meta/services.json
stocktrack/app/storage/sessions/cdf664ccf42d040bc92d76418f736cc78e20d77a
stocktrack/app/storage/views/81774cd762e1fa0174ad42e0b0d53196
stocktrack/bootstrap/compiled.php
stocktrack/composer.lock
stocktrack/vendor/

In .gitignore, I only added .idea. Why did it ignore the others?

like image 248
Volatil3 Avatar asked Feb 19 '15 05:02

Volatil3


1 Answers

You can use git check-ignore to determine if a path is getting ignored by git.

Furthermore check-ignore offers a -v (--verbose) option which will tell you about the pattern that ignores your file and where you can find it.


Let's assume you have a repository with the following directory structure.

bar/test/important
foo/a.tmp
foo/b

And this .gitignore file.

bar/
foo/*.tmp

You wonder why your important file in bar/test/ is getting ignored.

This is a pretty bland example, but it just serves to show the concept.

Now let's check which pattern ignores your important file.

$ git check-ignore --verbose bar/test/important
.gitignore:1:bar/       bar/test/important

As you can see, check-ignore tells you that the pattern bar/ in your .gitignore file on line 1 ignores the path in question.

like image 66
Sascha Wolf Avatar answered Sep 19 '22 21:09

Sascha Wolf