0

I have tried to put in .gitignore file in the root directory, and that works locally. But the remote repository I use does not allow files to be committed in the root directory.

So I tried pasting the .gitignore file in some other folder, but the files I need ignored are not ignored. I may be missing something, and I need git to look into that folder for the .gitignore file. How do you do this?

Gonzalo Matheu
  • 8,984
  • 5
  • 35
  • 58
  • 7
    It's strange not to allow to commit files inside the root directory, then how you would save something inside the repository? – MikeVelazco Jan 30 '18 at 00:10
  • 1
    1) If you're saving your .git repo and .gitignore in the root of your filesystem: don't. At least create a subdirectory for the project, and put your .git and .gitignore file there. 2) If you really must change the location of ,gitignore, look [here](https://stackoverflow.com/questions/15537686/how-can-i-tell-git-to-use-a-different-gitignore-file-than-gitignore) – paulsm4 Jan 30 '18 at 05:04
  • What research have you done to solve your problem so far? You tried to move the `.gitignore` file, what did you expect to happen exactly and how did the outcome differ from that? – LinFelix Jan 30 '18 at 06:35
  • @MikeVelazco: the way my remote git host works is that it won't allow files in the root directory, and only folders are allowed at the root level. – Prathamesh Shinde Jan 30 '18 at 19:37

0 Answers0