What is the preferred Git best practice when it comes to commit refactoring?

When I refactor some Java files in Eclipse, Git recognizes it has been 
renamed and places the file under "Changes to be committed".
I addition because the Java class file has been renamed the Class and all 
other classes that has references to it is listed under "Changes not staged 
for commit".

So I get this in Git:
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)


        renamed:    src/main/java/com/company/utils/MyConnectionFactory.java 
-> src/main/java/com/company/utils/ConnectionFactory.java


Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)


        modified:   src/main/java/com/company/utils/ConnectionFactory.java


Should I first commit the rename, and then commit the changes?

If I add the modified changes to be committed with the rename I get:
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)


        modified:    src/main/java/com/company/utils/ConnectionFactory.java


What is the preferred Git best practice when it comes to commit refactoring 
changes?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to