Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 955 Bytes

rename-branch.md

File metadata and controls

40 lines (26 loc) · 955 Bytes

Rename-branch command

Renames a branch both locally and remotely
Renames the given branch in the local and origin repository. Aborts if the new branch name already exists or the tracking branch is out of sync.
  • creates a branch with the new name
  • deletes the old branch

When there is a remote repository

  • syncs the repository

When there is a tracking branch

  • pushes the new branch to the remote repository
  • deletes the old branch from the remote repository

When run on a perennial branch

  • confirm with the "-f" option
  • registers the new perennial branch name in the local Git Town configuration

Usage

git town rename-branch [<old_branch_name>] <new_branch_name>

Flags

--force   Force rename of perennial branch