Converting file (tracked with Git) from Java to Kotlin in Android Studio

前端 未结 2 1677
北恋
北恋 2021-02-12 04:56

A conversion from Java to Kotlin in Android Studio 2.3.2 (in 3.0 the same behaviour) creates a new file and deletes previous. So Git doesn\'t know anything about this conversion

2条回答
  •  长发绾君心
    2021-02-12 05:24

    In case this might help a future reader:

    If you use the Git commit dialog integrated with IntelliJ (Commit via Ctrl+K), there is a checkbox on the right in recent versions: ☑ Extra commit for .java > .kt renames

    Submitting the dialog this way will create two commits, the first one being just .java files renamed into .kt files with no content changes. This helps Git track the content.

提交回复
热议问题