O
O
OlegStulnev2018-07-12 19:01:51
git
OlegStulnev, 2018-07-12 19:01:51

How to move to another branch without a commit?

Hello, I have a question about git. After executing the "composer update" command, the "composer.lock" file changes and I cannot switch to another branch until I make a commit. How to make it so that it would not be necessary to make a commit?
Here is the text of the error:
error: Your local changes to the following files would be overwritten by checkout:
composer.lock
Please commit your changes or stash them before you switch branches.
Aborting

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arman, 2018-07-12
@OlegStulnev

why would you do a "composer update"? if you need to install what others have done, then you need to do "composer install"

A
Alexey Kopendakov, 2018-07-12
@alex_kag

As far as I understand, this file must be registered in .gitignore and git will not pay attention to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question