Search code examples
gitgerrit

How to mage git rename already commited deleted and added file?


I use gerrit. I first created a copy of a FooService -> to BarService, changed it and commited it. Later I Removed FooService, commited it. FooService is visible in gerrit as deleted, BarService as Added. How can I fix it, to be visible as renamed FooService->BarService, before I merge my change?


Solution

  • Probably you made too many changes in the original file so Gerrit (Git) is unable to recognize it. You can divide your change into two commits (changes in Gerrit): first, rename the file, and after that make the changes.