0

So I've tried several approaches and none seem to be working to achieve a seemingly simples thing.

I had to move a lot of images from my local pc to my web server and I used git for that, now I want to delete them from my pc but keep them on the web server.

I tried adding the image folder to .gitignore and ran git update-index --assume-unchanged <filename> and also git update-index --skip-worktree <filename>, but whenever I go and delete the file from my local repository and do git status under "changes to be committed" it has the "deleted" entry and if I push and then pull on the web server the file is removed.

I just want to keep the image files on the remote repository while being able to clear them from my local development machine.

out_sid3r
  • 1,018
  • 2
  • 20
  • 42
  • https://stackoverflow.com/search?q=%5Bgit%5D+delete+file+locally+keeping+remote – phd Aug 03 '22 at 10:28
  • Try sparse checkout: https://stackoverflow.com/search?q=%5Bgit%5D+sparse+checkout – phd Aug 03 '22 at 10:28

0 Answers0