A
A
Andrey Sanych2015-07-02 23:55:43
linux
Andrey Sanych, 2015-07-02 23:55:43

Why can't a file deleted from git be restored?

Hello. Such a problem.
At work, I develop one project on ubuntu and work with git. One zip file was considered unnecessary and removed. Then I needed to restore it and I successfully restored it with these commands:

git rev-list -n 1 HEAD -- имя_файла
git checkout найденный_коммит^ -- имя_файла

The content of the file was moved to the vendor folder, but this folder is ignored by git in gitignore.
Today I had to deploy a project at home on Windows. I downloaded the files from the repository, everything is ok. I remembered that this file was deleted and decided to restore it in the same way. And git answered me with an
error: pathspec 'vendor.zip' did not match any file(s) known to git.
I'm on the same branch as the file was deleted. I tried all kinds of ways to restore the file and looked through the logs, this file was not found and that's it.
What could it be and where to dig?
UPD: screenshot with the necessary commit
805ef0b0444643eaa96b76a04f5ad7e9.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
index0h, 2015-07-03
@index0h

And you should not want this)) what is in the vendor should be pulled up by the composer. In order not to change the lock, use: composer install -o
The fact that under Windows there can be troubles - well, well, vagrant will help.

N
nonlux, 2015-07-03
@nonlux

The assumption is this: there is no checkmark ^ after the commit to:
In general, if you need to save the file in the vendor, make a human .gitignore

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question