Should the .gradle folder be added to version control?

后端 未结 5 2100
被撕碎了的回忆
被撕碎了的回忆 2021-01-31 06:48

Gradle creates a folder called .gradle. Should I track it with my version control (i.e. git)?

More importantly, why / why not?

5条回答
  •  自闭症患者
    2021-01-31 07:15

    I was new to Gradle and thought that the .gradle folder will contain generic information such as dependency mappings, etc and uploaded it on version control. I then tried setting up a new machine with a different OS flavor and Java version using code from the version control including the .gradle folder and ran into errors. Turned out that the .gradle folder contains machine specific information and is used for caching on local. Do not include the .gradle folder in version control and try setting up a new machine with the code, the gradle daemon will do the rest.

提交回复
热议问题