Problems with GIT

0

I had some files modified on my local%%, but I did not update my repository-error for a long time.

But what happens is that I did not branch of the files and I was forced to give commit in all my reset , in order to be able to update my repository.

The problem starts here:

There were many modifications to many programs made ready to be sent to the server, and I have no idea how to recover files in my local%% zone, which were not even made branch of them ..

Can anyone help me?

    
asked by anonymous 09.03.2017 / 11:52

1 answer

0

If the files were in "modified" status, they already existed in index of Git, which is good news. You can recover all revisions of files that have been saved but abandoned with the

$ git fsck --lost-found

This command creates two folders within its .git directory: .git/lost-found/commits and .git/lost-found/other , and saves all files that have entered the GIT history when you save them but have not been used in those folders current project index.

Depending on how long this local copy has been used this may be a few hundred files, but there is a great chance that you will recover at least part of your work there.

From the manual:

git-fsck - Verifies the connectivity and validity of the objects in the database

--lost-found -  Write dangling objects into .git/lost-found/commit/ 
or .git/lost-found/other/, depending on type. If the object is a blob, 
the contents are written into the file, rather than its object name.
    
09.03.2017 / 19:24