0

After searching a lot I did this to move a dir to git ignore which was included in git:

step1: Adding folder in .gitignore: test/ step2: running: git rm --cached -r -- test/ step3: add and commit & Push

Now when I am creating a MR it is showing delete changes for test folder contents. So this means it will delete my changes in git but I dont want to delete it. I want to just add it in gitignore.

Please let me know how to do this so that I it can be gitignore in my remote as well.

PS: I do want to add this in gitignore. I am just wondering that if I create a MR for my live site and then pull the above commit so will it remove the test folder or only make this gitignore while the folder will present there

Also please let me know when we want to make any folder git ignore then should we need to do the steps both local and server separately?

My main question is this how can I safely gitignore this without deleting it on server and local both.

Thanks

Stack user
  • 519
  • 6
  • 19
  • 1
    Does this answer your question? [Can I 'git commit' a file and ignore its content changes?](https://stackoverflow.com/questions/3319479/can-i-git-commit-a-file-and-ignore-its-content-changes) – 1615903 Apr 28 '20 at 07:21
  • No actually it is different. I do want to add this in gitignore. I am just wondering that if I create a MR for my live site and then pull the above commit so will it remove the test folder or only make this gitignore while the folder will present there – Stack user Apr 28 '20 at 08:18
  • 1
    It will remove the test folder. – 1615903 Apr 28 '20 at 08:31
  • thanks and in server too then I need to follow all above steps to clear the cache? – Stack user Apr 28 '20 at 08:34
  • and make a commit. Also should I do this before taking pull or after on my live site/server – Stack user Apr 28 '20 at 08:35
  • @1615903 please let me know when we want to make any folder git ignore then should we need to do the steps both local and server separately? – Stack user Apr 28 '20 at 09:02

0 Answers0