0

Unfortunately, I introduced an error in my .gitattributes some weeks (and commits and pushes) ago. As a result the .gitignore of a subfolder of my project is assumed to be on git lfs. But for some reason, it never got pushed there. I corrected the wrong .gitattributes by a new commit. Now, everything is fine except that I cannot checkout older commits, which assume that the file exists in git lfs. I get the following error:

Error downloading object: testdata/.gitignore (42e0b88): Smudge error: Error downloading testdata/.gitignore (42e0b88b4a1842297d2671cd534dc6130a7a8fc4806bc7ef9bab82d38df32360):[42e0b88b4a1842297d2671cd534dc6130a7a8fc4806bc7ef9bab82d38df32360] Object does not exist on the server or you don't have permissions to access it: [404] Object does not exist on the server or you don't have permissions to access it

How can I fix that? Is there a way to push the file manually and give it the correct id? Or can I retrospectively fix the wrong commit?

SeeJayBee
  • 1,188
  • 1
  • 8
  • 22
ma0ho
  • 623
  • 1
  • 4
  • 17
  • I imagine a simple but tedious way is to revert your latest change by hand and then change the branch to point to HEAD~1, and now do git lfs push. This should fix up everything. git reset HEAD~1 --soft may work too. BTW, make a backup of your entire folder in case something go wrong or my method don't work. – glee8e May 22 '19 at 08:57
  • Hmm, but I think the problem is not my latest change, but some change some weeks ago, where I accidently started tracking `testdata/.gitignore` by git lfs without actually pushing it there.. – ma0ho May 22 '19 at 12:32
  • That sounds like your history is at least partially lost if there are nothing on the LFS server. Contact your LFS system admin to see if they can check the files are actually on server or not. If not, well, say good bye to your history. Sorry. – glee8e May 22 '19 at 12:50

0 Answers0