The problem is that .gitignore ignores just files that weren't tracked before (by git add). Run git reset name_of_file to unstage the file and keep it. In case you want to also remove the given file from the repository (after pushing), use git rm --cached name_of_file.

Understanding the Context

gitignore - How to ignore certain files in Git - Stack Overflow I'm working first time on Git. I have pushed my branch on Github and it pushed all the library and documents into Github. Now what can I do and how can I use gitignore command to avoid the same mi... github - How to use gitignore command in git - Stack Overflow Is it possible to set up files/folders to ignore on a per-project basis in TFS source control?

Key Insights

For example, I've a website with an assets folder that I do not want to go in to source control. These How to ignore files/directories in TFS for avoiding them to go to ... The * line tells git to ignore all files in the folder, but !.gitignore tells git to still include the .gitignore file. This way, your local repository and any other clones of the repository all get both the empty folder and the .gitignore it needs. How to .gitignore all files/folder in a folder, but not the folder ...

Final Thoughts

Input buffers ignore whitespace, so when you are reading in information from std::cin, the newline doesn't matter.. But when youre talking about getline, it gets the entire line up to the newline character, and when the newline char is the first thing the getline function sees, that is all it gets.