PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 31, 2022

[FIXED] Git can't see files installed by composer

 January 31, 2022     composer-php, git, github     No comments   

Issue

I have got following problem:

I installed some dependencies (symfony) into my project using composer install.

BUT when I'm trying to commit that, It can't see any files.

I've searched every .gitignore file, but I think this is not caused by ignoring these files - I've checked it with SourceTree and these files are not even in "ignored" or "all", they simply don't exist in git at all.

So, I've tried git add vendor/symfony/*, git add vendor/symfony/*/* etc., but it just added some folders into commit, and not files.

When I move entire symfony folder, nothing changes. Same if I rename something. But, if I make some file in symfony folder, which contains just other folder (no files), it appears. But - if I make file next to another files in symfony, it won't appear.

I've looked into /.git/info/exclude, but there is also nothing suspicious.

Platform: Windows 7 x64 git 1.8.4

Is there something about composer I don't know? Or am I missing something?

Thanks for answers.

EDIT:

Well, it is kinda strange, but I made it work.

First I tried to add single file with its full path (with git add). CMD throwed error, it is unable to add, because this file is in submodule.

According this advice I've tried git rm --cached -r vendor/symfony, and it probably cleared some references.

Then I could call git add again, BUT I had to use path to files (there was many embed folders) like git add vendor\symfony\browser-kit\Symfony\Component\BrowserKit\*.

I actually don't know what happened, but after I made .bat file and call this on all files there, I can commit it.

Thanks for your time, help and advices. :)


Solution

I am still new to git but I can share my own personal experience with adding files. I am still using various programs until I find a way that works best for me. I have installed MySysGit, TortoiseGit, and since I use GitHub I have the GFW program which installs PowerShell along with it.

Power Shell

The first thing I would type is git status. If you have untracked files then try to add the folder without the *. I have seen it recursively add files in the folder I specify and its sub directories. If that doesn't work then use TortoiseGIt.

git add vendor/symfony

As long as there is a vendor/symfony where you are in the shell it should add the files and it's sub directories.

TortoiseGIt

Right click the folder and look for a blue cross that says add. Once it discovers all the files select all and let it process them. Then use git status again to see what changed and possibly what else you need to do.

As long as there are untracked files TortoiseGit should add them and any sub directories.

Git Status

If git status doesn't show any untracked files, and there is no vendor/symfony in the git repo on your hard drive then I'd check and see if composer install needs other arguments to place the files where you expect them to go.



Answered By - Sharlikran
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing