Fixes the issues that a local branch is preferred over remote