Any idea how to recover local changes in a git repo after a find . -type f | xargs sed -i 's/[\t ]*$//g' in repo root dir?
Any idea how to recover local changes in a git repo after a find
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since I misunderstood the question at first, I think I should clarify that the problem here is that the command you’ve run will also have rewritten files in the git’s
objectsdirectory. (Clearly the files in your working tree can be restored using the usual suggestions ofgit reset --hard, with the usual caveat that uncommitted local changes will be lost.)I haven’t had to deal with this situation myself, but I would suggest the following:
git fsckto assess the damage – among other checks, this will see which files’ contents no longer match their hashes..git/configcorrectly and get the file permissions right.