I am new to git, I am trying to create a .gitignore file to ignore file while git add. I understand that I have to do
vim .gitignore
*.c(ignore c file)
*.cpp(ignore cpp file)
'dotSTAR' ignore every hidden file
I was looking at this answer, It says that you have to do
'!/.gitignore'
as well
Even though I know that it is saying that while you are ignoring
hidden files(.*
), do not ignore that /.gitignore
Can anyone explain to me why gitignore should not be ignored? What purpose it is serving here?