Git add not working for folder with .git folder

Also you might get something like
fatal: Pathspec ‘some.file.name.goes.here’ is in submodule ‘some/folder/name’
Also you might notice, if you commit and pushed, only some skeleton of the of the folder structure without the actual files would be committed.

The root of the problem is the folder you are trying to add is tracked under git itself.
This would confuse git and would rather leave it up to you.

the fix
First go ahead and remove the .git folder in the new directory

sudo rm -rf /path/to/new/folder/.git

Then clear the cache from git memory of the new folder

git rm -r --cache /path/to/new/folder

Then when you do the

git status

you will see all the new files being listed and you can commit that.

Browser shows the same image after the update

If there is an image change on the same file name, say logo.png or front.jpeg, the change won’t happen right away unless you force refresh it on browser to clear the cache.
The problem with this one is when you have dynamic updates and your users couldn’t see the change right away b/c of the cache.

The simple fix for this would be appending version at the end of the file name. Like your original html would look like:

img height="200" src="/path/to/image/file.ext" 

Then appending the version at the end

img height="200" src="/path/to/image/file.ext?v=someVersionGoesHere" 

For any backend it would be easy to append the versioning when the image is presented. It could be random number or unix timestamp would work in this case too..

If you are generating the images from javascript, say based on the json response, you can do

var version = new Date()->getTime(); //get the unix timestamp
var path = "/path/to/image/file.ext?v="+version;

$('#image_id').attr('src', path);

Shall do the trick. I used jQuery her but, it is not limited to it..

symfony production path not working but works on dev environment

If you are working on the symfony and testing the changes, and you want to look at how it looks on the production env by just changing the url.. and if you are not seeing your current changes – most probably it is caching issue:
do the following being in your symfony project..

php app/console cache:clear --env=prod --no-debug

That is it