0

On my laravel installation i have an envoirement file and a folder of XML files that i need, but don't want to include in my git REPO.

On my local pc:

XML/

.env

i did:

git rm -r XML

git rm -r .env

And pushed the changes.

But that deleted the file from my pc, which i don't want. I only want to delete is from my git.

if i now pull on production it deleted the .env en XML file.

Any help is appreciated.

Rubberduck1337106092
  • 1,294
  • 5
  • 21
  • 38

2 Answers2

2

My .gitignore looks like

.DS_Store
nbproject/private/
app/tmp/cache/models/
app/tmp/cache/persistent/
app/tmp/cache/views/
app/tmp/logs/
Keyur Padalia
  • 2,077
  • 3
  • 28
  • 55
1

First, make sure the files are listed in .gitignore (or .git/info/exclude).

Then, if you want to remove files from the repository, but not from your working tree, use git rm --cached:

git rm --cached -r XML .env
git commit

This will stage the files for deletion, but leave the working copies intact.

Will Vousden
  • 32,488
  • 9
  • 84
  • 95