I understand that the settings file you are talking about is your settings, not the .git folder. If I understood correctly, then this does not always work to add them to .gitignore, because all that .gitignore does is that it does not check these files locally when you use 'git commit -a', 'git diff ', etc., but if you already have them in your local repository, they will still be transferred to the remote server.
Having said that, I don’t think you lost your settings file on the remote server, because all you did was add more commits, so you should find the settings file in the history.
In any case, unfortunately, unlike SVN, if you just learn a few steps on using GIT, you will always be mistaken. At first I made a lot of mistakes, then admitted that I need to read a book about this. But at first I wanted to understand its concepts, because this is what sometimes causes problems (for example, what is the difference between “master of origin” and “source / master”, etc.), so I found this very useful page, and I recommend read it to you:
http://www.eecs.harvard.edu/~cduan/technical/git/
And I also found this very interesting book:
http://progit.org/book/
You do not need to read all this, just read the basics and, most importantly, branching.
Hope this helps.
source share