1

I have a question about .gitignore. enter image description here

I use Intellij IDEA to automatically generate what folders to ignore. In .gitignore it wrote ../.idea/. In the git status view, I still can see it:

enter image description here

1
  • Just google gitignore jetbrains. Copy paste the result into your gitignore.
    – user8502296
    Nov 3, 2017 at 3:58

3 Answers 3

4

If your git status shows ../.idea, that means your .gitignore is one folder below:

/path/to/repo
   .idea
   asubfolder
     .gitignore

Make sure your .gitignore is at the same level as .idea, and use:

.idea/
0
0

You should just put .idea without ../ in the .gitignore

0

Here it is what you generally need IDEA, Eclipse, NetBeans, target folder... in .gitignore

target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/

Be sure after this you run git rm -r --cached .

2
  • 2
    Why is maven-wrapper.jar excluded here? Why isn't the pom self-contained?
    – Peter Hall
    Aug 13, 2018 at 19:17
  • 1
    @PeterHall actually maven-wrapper.jar can be used for running maven project without maven installed/not find in the relative path. For example; spring-boot project automatic installation for granting encapsulated built setup. Aug 14, 2018 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.