There are many similar topics on SO and I've read quite a few of them but the problem remained.
I want to be able to put a folder or file name in gitignore so that it doesn't appear in the repo online but remains locally.
What I did:
git rm -r --catch .
, then git add .
files back, commit and it would work. It did not.git rm -r --catch
individually. Strangely it only works on some folders. Not to mention I have to do it for many folders.I tried: folder_name
, /folder_name
, folder_name/
, folder_name/**
. From 3 folders only 1 would be inored.
If I try creating a new folder with a random name and adding it to ignore the file, it would be ignored.
Before any copy/pasting files back to the local repo folder I deleted the hidden git folder inside it.
This is the picture of my structure ibb.co/F4WrX81 I just wanted to point out that I've used git casually before, more so to get used to it really, and it was all good. Here is an example ibb.co/S5y7LBM I would just create a project, work on it some time, then add gitignore, and everything would go smoothly
Any help or suggestions are much appreciated. I can either redo the whole thing or do some bashing. Don't really care at this point.
Thanks in advance.
Add a filter into .gitignore
will not delete matching files/directories.
It will make git ignore it on any none specific command. rm
command included.
So do it in multiple steps:
.gitignore
to add filters for folders to ignore.