N
N
Nurlan2016-02-01 10:38:51
git
Nurlan, 2016-02-01 10:38:51

What is the correct way to use Composer along with GIT?

Greetings.
I thought about how best to use composer along with a remote repository.

  1. Install composer on local machine
  2. install a package
  3. send it as a commit

Or is it better to use the composer update git hook instead of the third step?
How to organize this if I'm not the only developer?
I hope for your advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2016-02-01
@daager

Composer packages do not need to be placed in a repository (/vendor in .gitignore).
After installation, composer.json and composer.lock are committed.
Another developer simply does a composer install and installs what is missing.
composer update will update packages every time and rewrite composer.lock instead of just installing what's in composer.lock.
If someone does not have Composer installed, strongly demand to install it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question