Copy an existing branch to a new branch with the provided name. To rename default branches, such as `main` to `master`, this function is run followed by pointing the repo to the new branch as the default before deleting the original `main` branch with: ``` git push origin --delete main ``` See Git Tower FAQ: Rename Master to Main for full details. .

copy_branch(path = getwd(), branch, new_branch_name, remote_branch = "origin")