Git Rename Branch – How to Change a Local Branch Name Step 1: Ensure you are in your project's root directory.  Step 2: Go to the branch you want to rename.  Step 3: Use the -m flag to change the name of the branch.  Step 1: Make sure you are in the master/main branch.  Step 2: Use the -m flag to rename the branch.