My project has been considered a legacy and I started over. Here is what I did:
-
I checked out from
develop
branch of current project into my newrefactor
branch. -
Then I did
git rm *
to remove all files and start over. -
While working on new branch, some changes are made to original
develop
branch and committed.
Now when I finish my refactor branch, How should I safely merge or rebase this branch to develop so that it completely overrides?
Here is my thought:
Option 1. Just swap branch names.
This is simple solution but I should be the last option because doing so in remote branches would confuse my teammates. Next time they git pull
I’m not sure they would get refactor
branch pulled correctly. tell me if I’m wrong.
Option 2. Merge
Option 3. Rebase
Maybe doing rebase
would mean doing git rm *
on the latest commit of develop branch again which is what I want? But what would happen if I merge?