0

I tried to rename a package in Android Studio as shown in this question: Rename Package Android Studio

Now I have the problem that GIT does not recognize the files as being moved but instead thinks that all files are deleted and new files are created somewhere else.

I am afraid that this will prevent GIT from auto-merging this change in the package structure.

Is there a way to refactor the package name so that git recognizes this change? Or should I "refactor" the package the hard way myself i.e. after git mv com/example/app/name com/example renaming the package with a global replace of com.example.app.name to com.example.name with CTRL + SHIFT + R in Android Studio?

Aldinjo
  • 394
  • 1
  • 7
  • 21

1 Answers1

1

I have same problem when I rename the package / file name between uppercase and lowercase. I normally rename the package / file name by adding an extra character and commit. Then change to the correct name and commit one more time. It works with git. You will get more detailed answers here How do I commit case-sensitive only filename changes in Git?.

flame3
  • 2,812
  • 1
  • 24
  • 32