0

Recently I've started attempting to use git to transfer my projects between my computers but have run into a problem. I am using Android Studio and Bitbucket. Every time I go about cloning the repository the some of the files (gradle.xml , misc.xml, modules.xml for example) change.

Does it matter if these files change in my projects? Also why do they change when cloning the project?

Any help would be appreciated.

Empyreus
  • 1
  • 1

2 Answers2

0

Normally GIT doesn't change any files while cloning a repository.

But if you transfer your project code between many computers with different settings and maybe operation systems it would make sense that configuration files of android studio will be different for each computer.

So it would be a solution to do not track these files with GIT.

You can protect files from being tracked by GIT using a .gitignore file.

https://git-scm.com/docs/gitignore
Ideal Android Studio gitignore file

Community
  • 1
  • 1
0

Yes, it's normal for a lot of files to change - but because of the Android Studio and gradle build system. In particular, I have this in my .gitignore file:

local.properties
.gradle
.idea
build
gradle
*.iml

The "build", ".gradle" and "gradle" directories are all files generated from gradle that you should not put in your repo.

The ".idea" directory and "*.iml" and "local.properties" are created by Android studio based on your environment and other settings.

All of those can be safely ignored in your repo.

Jim
  • 10,172
  • 1
  • 27
  • 36