8

I want to commit my Android App code to a git repository. For this purpose I require a proper .gitignore file so that I can avoid commiting unnecessary and bloating stuff to the repo.

So I was wondering if anyone could provide me a good one for a kotlin project.

I have went through some questions here on StackOverflow, but those .gitignore are JAVA Project oriented, and I want one with kotlin orientation.

Ayush Gupta
  • 7,958
  • 7
  • 50
  • 85
  • 1
    It is pretty much the same gitignore file for kotlin than for java – donfuxx Dec 17 '17 at 16:00
  • Does this answer your question? [What should be in my .gitignore for an Android Studio project?](https://stackoverflow.com/questions/16736856/what-should-be-in-my-gitignore-for-an-android-studio-project) – lcnicolau Mar 29 '20 at 15:54

1 Answers1

-1

There are no big differences between a gitignore from android with java to android with kotlin.

The differences are in the build directory, so since you should have a build entry in your .gitignore, this one will be enough.

One possible difference is if you have an entry like:

!**/src/java/build
!**/test/java/build

Then you will need to update it, but a better one can be:

!**/src/**/build
!**/test/**/build

If you don't have any .gitignore in your current repo, you can check this repo:

https://github.com/JetBrains/kotlin-examples/tree/master/gradle

It has a lot of examples of projects with android and kotlin and each one has a .gitignore that you can copy.

jonathanrz
  • 3,966
  • 6
  • 33
  • 55
  • It has a lot of unnecessary stuff, like Jira and Mongo files. If you are not using them, I recommend that you removing it. But besides it, this gitignore is really good, it has everything that I remember it needs. – jonathanrz Dec 17 '17 at 16:32