0

I'm trying to push local commits to my repository on Github, but I keep getting this error.

Uploading LFS objects:   0% (0/1), 0 B | 0 B/s                                  
open E:\Unity Projects\MysteryNarrative\Assets\NotificationsSamples- 
master\Assets\Demo\Sprites\cookie.png: The system cannot find the path specified.
error: failed to push some refs to 'https://github.com/james-sullivan/MysteryNarrative'
Completed with errors, see above.

Before I got this error, I deleted a bunch of files that were in the project, including the one that it is complaining about not finding. Looking back at the commit where I deleted those files, the Demo\Sprites\cookie.png had been recorded as deleted, so I'm very confused as to why it's still looking for it.

I tried just force pushing it to the repo, but it still came back with this error. I also tried creating and committing a png file called cookies at that specified location, but it still wasn't happy.

I'm also using the beta version of the Sourcetree GUI on Windows in case that makes any difference.

I'm not very experienced with source control and any help would be greatly appreciated :)

j76goatboy
  • 405
  • 2
  • 7
  • 16

1 Answers1

1

When you use LFS, the files specified are not controlled through git- only a pointer file.

Can you switch to command line and run the following commands?

git lfs status
git lfs push origin <branch-name>

If that does not work, try checking out an older commit - before you deleted the files

git checkout <commit-id>
git lfs checkout
git lfs status

If the cookie.png file exists and you can open it, then you should be able to push it to the server.

If it does not, then you may have to remake the image/copy it back into the repository.

Note: I have not used sourcetree, so someone else may be able to provide better feedback

Ben W
  • 930
  • 6
  • 16
  • The first two commands ran without complaint. But when I tried to check out a previous commit it failed and gave some errors. I think the problem is that I added some assets to my project that made git think that I was using LFS, even though I haven't even heard of LFS until I started trouble shooting this problem. I'm not sure how I can get back to a state before I added those files while still keeping the other changes that I've made. – j76goatboy Jul 17 '19 at 21:56
  • LFS is added onto git through the use of githooks. Go into the .git/hooks/ folder and delete the files there. This will make sure that no commands will run when you try to do normal git commands. You should also check the root of your repository for an .gitattributes file. This file may specify certain files use lfs. – Ben W Jul 18 '19 at 12:26
  • I've tried deleting all of the files in the hooks folder and all .gitattribute files that are in the repo, and I ran 'git lfs uninstall', but those files get regenerated whenever I run a command. It seems that there's some other part of lfs that is still holding on for dear life. – j76goatboy Jul 18 '19 at 21:30