Amit
Amit

Reputation: 3754

git: how to revert file which is in .gitignore [fatal: empty commit set passed]

My .gitignore file has the following line

vendor/

I have modified a file inside the vendor folder. Now when I do update my bundles by performing -

bin/vendors install

"Bundle name" has local modifications. Please commit or revert/push them before running this command again.

I realize that I should have not changed anything in bundles and am trying to correct that mistake.

When I try to revert the file by issuing the command:

git revert <path>/<filename>.twig

I get this error message

fatal: empty commit set passed

git rm doesn't work either.

How can I make my bundle install?

Upvotes: 2

Views: 3347

Answers (1)

Quentin
Quentin

Reputation: 2529

You can do either:

  1. Revert the file you changed to its initial state:

    git checkout path/to/file
    
  2. Remove the vendor/ directory and run bin/vendors install again. That way you are sure everything is new.

A rule of thumb of thumb is that should NEVER modify files in the vendor/ directory.

Hope that helps!

Upvotes: 3

Related Questions