I added several folders to a project whose repository is on github. I would like github to automatically add but folders to the remote repository (because too many), so I used the following command but nothing:
git add *
they gave me an error due to node_modules and prisma, so I created a file .gitignore containing this:
node_modules
prisma/migrations
but when I reexecuted git add *
command I get error:
The following paths are ignored by one of your .gitignore files:
node_modules
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"
I looked at this page but I still can't add my folders to the original version of the project. I really don't know how people add new folders to their repositories. Please don't refer me to any docs to read as I have read and tried so much but nothing. You would help me a lot by giving me the orders. Thanks!
CodePudding user response:
Do git status
to see how git currently sees your files and folders.
If you want the folders to exist, but not any of the contents inside them, make sure your .gitignore file looks something like this:
node_modules/
prisma/migrations/
When you don't have a / at the end of a directory in this file, it'll ignore the directory, which isn't what you want from how your answer is worded