backport - checkout credentials according branch name