I have a problem when updating the vendor "kriswallsmith/assetic": "1.1.*", the update gives me this output :
Updating kriswallsmith/assetic (dev-master 5591252 => v1.1.2)
[RuntimeException]
The .git directory is missing from /home/smiles/Downloads/auth_Project/vendor/kriswallsmith/assetic, see http://getcomposer.org/commit-deps for more information
This literally means what it says: the .git directory is missing from this vendor directory. Simply remove the whole assetic folder, then run composer update again. This will add assetic again and the .git folder. (If the kriswallsmith vendor namespace is empty, then you are safe to remove that empty folder as well.)
This can happen if - for example - you are using subversion and all .git folders are ignored. Upon next checkout this folder will not be present.
Related
I want to remove the meteor installation from my meteor project directory while keeping my source code intact, so that I can archive the project without the installed packages. I also want the package configuration to be retained in the archive so that I can re-install the project without having to re-add and re-remove the packages again.
How do I do this?
Meteor already creates a .gitignore file for you. That file tells you everything that should be archived. So you can simple look at that file and only archive that (either by deleting everything else, or just writing a script that reads the .gitignore file and interprets it). Alternatively, of course, you could just add everything to git (in which case git will interpret the .gitignore file for you), and then create an archive from the git repo.
Of course, that .gitignore file only excludes .meteor/local, so as Kyll already said, you could just delete that folder.
When we pull a revision from Github than it is not ignoring the files and directories which are placed in .gitignore file.
It is pulling all the files and directories.
How to resolve this issue? I need to ignore some files and directories when pulling from github.
This is how my current .gitignore file looks like -
/vendor
/node_modules
Homestead.yaml
Homestead.json
.env
.idea/workspace.xml
/config/test
/storage/logs/laravel.log
I suspect what is happening is, the files you are trying to ignore using .gitignore were previously tracked (before ignore statements were added).
So to make the repository forget the files in git ignore look at this answer here:
How to make Git "forget" about a file that was tracked but is now in .gitignore?
That being said, if you actually "mean" exactly what you have written in your question, that suggests your understanding of how .gitignore works is flawed.
.gitignore does not prevent the files from being pulled down from the repository. It prevents them from getting committed to a repository in the first place.
when I install Symfony according to the guide (option 1 with composer) it creates the folder structure as expected (and mentioned in that guide):
path/to/webroot/
Symfony/
app/
src/
vendor/
web/
But in the root folder it also creates an empty vendor/ folder. In this vendor folder there is a subfolder named composer/.
path/to/webroot/
Symfony/
vendor/
composer/
Both directories are empty (no hidden files). So two questions:
Is this a required folder or is it kind of a bug that these folders are installed? Or may this be a directory for composer-specific files?
Can I delete this folder without any danger?
That empty folder is generated when you don't pass the target-directory parameter to composer:
php composer.phar create-project vendor/project target-directory [version]
I have an already started Symfony2 project. I need to install a new bundle, and as I saw i need to add a new line to my composer.json and then execute the update command.
The thing is, my composer.phar file and the .json are on different folders.
/httpdocs/composer.json
/bin/composer.phar
So after I add this line to the .json file:
"doctrine/mongodb-odm-bundle": "3.0.*#dev"
If then i try /bin/php composer.phar update doctrine/mongodb-odm-bundle i got an error saying that the composer.json is not there and is correct of course. So my doubt is WHY thoose files are in different folders? does the previous developer make a mistake? Should I move the files to a same folder? To bin or httpdocs?
It doesn't matter where the composer.phar lives. The relevant part, that your current working directory is in the symfony project (where the composer.json lives). Then simple execute composer (if the execute bit is set, no call to php is required).
/bin/composer.phar update doctrine/mongodb-odm-bundle
You can have a global composer.phar and use only this one. This is how you would normally have it on a development machine where you have multiple composer projects.
Some people tend to put a composer.phar into their projects so they can deploy it together with their application.
Solution to composer complaining about the missing composer.json:
you have to change your working directory to the path where the composer.json you want to use is located. ( every composer project has it's own composer.json )
This means cd into your project directory ...
cd /path/to/yourproject
... Before executing
/bin/composer.phar update ...
Alternative:
You can specify a working directory for composer with the --working-dir option.
This way you point composer to your project from any current working directory ( even if you project's path differs from where your cwd is ) . example usage:
composer --working-dir=/path/to/yourproject <command>
Tip #1
rename /bin/composer.phar to /bin/composer
mv /bin/composer.phar /bin/composer
chmod +x /bin/composer
Then you can simply ( assuming /bin is in your PATH ) ...
composer <command>
Tip #2
You can check where you currently are with pwd ( *p*rint *w*orking *d*irectory )
pwd
I am using the KNP Pagination Bundle. I customized the twig file in the bundle source. Then I found a better way of doing it without touching the bundle's files.
Unfortunately, now everytime that I do
bin/vendors install
I get the following error:-
"KNP Paginator Bundle" has local modifications. Please revert or commit/push before running this command again.
My .gitignore file has ignored /vendors
And my deps file has the bundle included too.
Is there a way to uninstall a bundle? So that I can reinstall it?
Or what is the best way to solve my problem?
./bin/vendors doesn't care about content of .gitignore. You can fork desired bundle, do your changes there and change deps file to point to your fork instead.
If you still want to use original bundle and just reinstall it, you can either run ./bin/vendors install --reinstall or just delete the bundle folder from vendor directory and run ./bin/vendors install again.
How about using git --reset? The vendors are fetched using git clone after all.
Can you explain what "git reset" does in plain english?