I had a similar problem. I wanted to ignore 'backup' folder. I've removed it from the project directory, pushed the changes to Github and then copied the the folder back again again. This time it was ignored. I also suggest using GitHub Desktop it makes life much easier!