I see that, when creating a new project in Android Studio (v2.2.2), a .gitignore
file is automatically created. It consists of the following:
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
The project folder consists of the following files/directories at the root:
Tele1.iml
app
build
build.gradle
gradle
gradle.properties
gradlew
gradlew.bat
local.properties
settings.gradle
Based on this, what is the proper way to commit the basic, default project to Git? Can I simply do git add .
and can expect that what should be committed will be and what should be won't? If I do this, this is what gets added to the repository:
A .gitignore
A .idea/compiler.xml
A .idea/copyright/profiles_settings.xml
A .idea/gradle.xml
A .idea/misc.xml
A .idea/modules.xml
A .idea/runConfigurations.xml
A .idea/vcs.xml
A app/.gitignore
A app/build.gradle
A app/proguard-rules.pro
A app/src/androidTest/java/local/abc/tele1/ExampleInstrumentedTest.java
A app/src/main/AndroidManifest.xml
A app/src/main/java/local/abc/tele1/MainActivity.java
A app/src/main/res/layout/activity_main.xml
A app/src/main/res/mipmap-hdpi/ic_launcher.png
A app/src/main/res/mipmap-mdpi/ic_launcher.png
A app/src/main/res/mipmap-xhdpi/ic_launcher.png
A app/src/main/res/mipmap-xxhdpi/ic_launcher.png
A app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
A app/src/main/res/values-w820dp/dimens.xml
A app/src/main/res/values/colors.xml
A app/src/main/res/values/dimens.xml
A app/src/main/res/values/strings.xml
A app/src/main/res/values/styles.xml
A app/src/test/java/local/abc/tele1/ExampleUnitTest.java
A build.gradle
A gradle.properties
A gradle/wrapper/gradle-wrapper.jar
A gradle/wrapper/gradle-wrapper.properties
A gradlew
A gradlew.bat
A settings.gradle
Many blogs have talked about this and many say different things and I'm not sure what is right and wrong. Thanks.