I just have done a git push in our online repo
When I checked the online repo and checked the public folder it shows this:

while in my local repo I have this in my public folder:
My local has Storage folder from my storage link. I am guessing that this has something to do with the .gitignore inside my local public folder. It contains:
*
!.gitignore
Same goes with my storage folders. In our Online repo inside storage/app/public:

while in my local storage folder:
user_images is present in my local repo. Here is the inner .gitignore:
*
!.gitignore
and the outer .gitigore:
*
!public/
!.gitignore
I am not quite familiar with setting rules in .gitignore. I wish to make sure that whatever my local Storage and public folder has, the Online repo has as well. How should I go about in doing this?
Kindly edit my tags if it is misleading or incorrect. Thank you.
This is the content of the root .gitignore:
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
I have removed /public/storage in .gitignored and tried to do a git push
Changes not staged for commit:
        modified:   .gitignore
and still, nothing is the same from my local to Online repo? Anything I might have missed?
Tried running git check-ignore -v path/to/file
In my root .gitignore:
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
If I ran git check-ignore -v public/hot, it replies with .gitignore:2:/public/hot        public/hot but if I ran git check-ignore -v public/storage, it doesn't respond with anything which it should because it is included in root .gitignore I come to believe that this situation made it impossible for the public/storage/user_images and storage/app/public/user_images. Any help is needed.
I may have been viewing a wrong file or path all this time. But I can confirm that @VonC method helped me do a proper exclusion in gitignore. Thanks.
EDIT:
Final gitignores so far
root .gitignore:
/node_modules
# /public/hot
# /public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
storage\app.gitignore
# *
# !public/
!.gitignore
storage\app\public.gitignore
# *
!.gitignore
public\storage.gitignore
# *
!.gitignore
Just an additional info:
git check-ignore -v vendor gives .gitignore:5:/vendor    vendor
while git check-ignore -v /vendor gives fatal: C:/Program Files/Git/vendor: 'C:/Program Files/Git/vendor' is outside repository
I'm not sure where git check-ignore -v path points to.


 
     
    