Marius Barbulescu
05/24/2026, 1:58 PMkotlin init? Or update existing if one is already available.joffrey
05/24/2026, 3:11 PMinit doesn't generate a git repository. So it should either not do anything git-related like now, or also generate a git repo. But not everyone wants a git repo. Maybe we could add this as an option like --init-git or something.joffrey
05/24/2026, 3:11 PMbuild to your .gitignore at the moment. A default .gitattributes would arguably be more useful.Fedor Ihnatkevich
05/24/2026, 6:27 PMBut not everyone wants a git repoIt's a very popular need though. So it's a good default. And if in some cases there are no plans to create a git repo, the
.gitignore file will not hurt anybody.mbonnin
05/24/2026, 9:33 PM.gitignore. Make it another question in the interactive CLI? Create a git repository? [*y*/n] (defaults to true)mbonnin
05/24/2026, 9:34 PM.idea default in .gitignore as well if that’s possiblejoffrey
05/25/2026, 9:19 AM.gitignore would be incorrect IMO. Either we generate .gitattributes as well or nothing, and maybe we should actually create a git repo (as in git init), but that's a bit more controversial.joffrey
05/25/2026, 9:19 AM.git folder and generate the git files automatically in that case (as a default behavior), then we could force-disable or force-enable explicitly.joffrey
05/25/2026, 9:21 AMmbonnin
05/25/2026, 9:21 AMmbonnin
05/25/2026, 9:21 AMjoffrey
05/25/2026, 9:22 AMmbonnin
05/25/2026, 9:22 AMjoffrey
05/25/2026, 9:22 AMmbonnin
05/25/2026, 9:22 AMmbonnin
05/25/2026, 9:23 AMmbonnin
05/25/2026, 9:23 AMmbonnin
05/25/2026, 9:24 AM.git foldermbonnin
05/25/2026, 9:24 AMjoffrey
05/25/2026, 9:26 AMgit init) and then create the target repo on GitHub, add the remote, and push?mbonnin
05/25/2026, 9:28 AMmkdir reproducer-1011
cd reproducer-1011
touch settings.gradle.kts
touch build.gradle.kts
idea .
# edit the code, idea will pull a Gradle wrapper, etc...
git init
git add .
git commit -m "initial commit"
gh repo create
# push the repo to github
I want kotlin init to do steps 1-8 automagically. Then I only have to call gh repo createjoffrey
05/25/2026, 9:28 AMmbonnin
05/25/2026, 9:29 AMmbonnin
05/25/2026, 9:29 AMcp ../apollo-kotlin/.gitignore .
Because I spent some time fine tuning my Apollo Kotlin gitignore. But it'd be even better if kotlin init provides onembonnin
05/25/2026, 9:30 AM.idea/codeStyles directory mainly)mbonnin
05/25/2026, 9:31 AM.idea/codeStyles but .editorconfig and this is fine by me.joffrey
05/25/2026, 9:31 AM.idea default in .gitignore as well if that’s possible
While it's possible I would certainly not want to do that for 2 main reasons.
1. If you personally use IDEA and generally want to ignore .idea, that should be in your global config, so you don't pollute individual repos with IDE-specific config (not everyone uses this one, and the ones who do can ignore it on their machine)
2. .idea is a bastard folder that actually contains things you might want to share, so better add a .idea/.gitignore with proper settings depending on what you want to share in each projectmbonnin
05/25/2026, 9:32 AMkotlin init is a great way to share an opinionated best practice therembonnin
05/25/2026, 9:34 AMnot everyone uses this one, and the ones who do can ignore it on their machineI don't like having every developer having to tune their machine. Ideally a checkout should work for all devs in the team regardless of the rest of the machine
mbonnin
05/25/2026, 9:34 AMjoffrey
05/25/2026, 9:34 AMmbonnin
05/25/2026, 9:34 AMit depends on what you want to share in the specific project. Do you share run configs? Code style? Copyright config?Sounds like all of that needs to be shared?
joffrey
05/25/2026, 9:34 AMjoffrey
05/25/2026, 9:36 AM.DS_Store) in my project. It's something a responsible macOS user should globally ignore, not a project thingmbonnin
05/25/2026, 9:36 AMDS_store in my .gitignore 😄joffrey
05/25/2026, 9:37 AM.gitignore is exactly where it should be, yesmbonnin
05/25/2026, 9:37 AMjoffrey
05/25/2026, 9:37 AMmbonnin
05/25/2026, 9:38 AM.idea is not in .gitignorembonnin
05/25/2026, 9:38 AMjoffrey
05/25/2026, 9:38 AMmbonnin
05/25/2026, 9:39 AMmbonnin
05/25/2026, 9:39 AMkotlin init could come with good defaults, that'd be greatjoffrey
05/25/2026, 9:39 AMktfmt I guessmbonnin
05/25/2026, 9:39 AMktfmtFrançois
05/25/2026, 10:13 AM.DS_Store
/.build
/Packages
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrcmbonnin
05/25/2026, 10:16 AMcreate-react-app is doing:
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*Marius Barbulescu
05/25/2026, 10:39 AMgit clone ... and then I create the project.joffrey
05/25/2026, 10:44 AMgit clone ... and then I create the project.
Same flow for me usually. The reason I'm asking is that, in that case, we can detect the presence of an existing git repo, and we could generate git config files accordingly.
But it also shows the conflicting responsibilities: on GitHub you'll get to choose a gitignore template. It makes sense because they are responsible for the git stuff, so they let you configure git. The Kotlin CLI is responsible for the Kotlin project config, and that's why so far we stuck with Kotlin Toolchain config files. So philosophically, we're not supposed to do that. But of course we want to be pragmatic here, and help where we can.Marius Barbulescu
05/25/2026, 10:45 AMmbonnin
05/25/2026, 10:46 AMkotlin init to take a dir parameter:
kotlin init my-app
and fail if the directory already existsmbonnin
05/25/2026, 10:46 AMkotlin create in that casembonnin
05/25/2026, 10:46 AMkotlin create my-appmbonnin
05/25/2026, 10:47 AMmbonnin
05/25/2026, 10:47 AMjoffrey
05/25/2026, 10:47 AMinit 🙂 We'll surely do something about it. It's also so easy to run kotlin init in a parent directory by mistake and create a messjoffrey
05/25/2026, 10:50 AMkotlin init to detect existing files and ask for confirmation or fail in this case (we could exclude common files from that check, like README[.md], LICENSE[.md], .git, .gitignore, .gitattributes, etc.).