.gitignore with Scala in InteliJ problem

Hi,

I have a problem.

I have a simple project to Advent of Code 2018 and I want to commit and push on my repo without .idea and target catalog. I create .gitignore file from https://www.gitignore.io/ , and next create my new repo. But when I finally push, my repo have .idea and targret catalog.

Why? What I doing wrong?

my tree of project:

image

I want a repo:

Proj1/
Proj2/
(…)
.gitignore
README.md

There is an excellent gitignore plugin for IntelliJ, you might try that.

How does your .gitignore file look like? Does it have these lines:

.idea/

target/

I resolved this problem. I used Cygwin instead Git Bash for Windows10.