After we create a project in Android Studio, we often use version control to control the code, but which files in the project should be submitted to version control?
In fact, Android Studio has already done it for you!
.gitignore
There is a file under Project and app , as follows:
Ignored files under Project:
*.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures
Ignored files in the app folder:
/build
It can be seen from the above that:
- All
.iml
documents do not need to be submitted -
build
The files in the folder do not need to be submitted, this is the compiled file - Local settings related files do not need to be submitted
- The files during performance analysis will be in the /captures folder and do not need to be submitted
If you share the project on Github, do the following:
- Open AndroidStudio, create a new project
-
VCS
—>—>Import into version control
Share Project on GitHub
Then AS will automatically select which ones need to be submitted to version control, as shown below: