0

i accidently added some of storage files to my git repository that i want to remove them from local machine now but they have to remain on server . so what i did is cloning the project on my local machine and then added this line to my .gitignore :

/storage/app/public/product

and after that i removed the files from my local machine. now when i make change on other files it tries to commit the changes which was made on that files and tries to remove them on repository too . now what i want is 1-remove them from local machine and not commit them 2-remove them from repository and it wont remove them on live server

Farshad
  • 1,830
  • 6
  • 38
  • 70
  • https://stackoverflow.com/search?q=%5Bgit%5D+remove+files+from+repository+leave+on+server – phd Sep 30 '20 at 13:24

1 Answers1

0

Remove git cache by running below codes

git rm -r --cached .

Then:

git add .

And at the end commit

git commit
SEYED BABAK ASHRAFI
  • 4,093
  • 4
  • 22
  • 32