Optionally, run the following command to remove tracking references to the old branch name. $ git branch -u origin/NEW-BRANCH-NAME NEW-BRANCH-NAME $ git branch -m OLD-BRANCH-NAME NEW-BRANCH-NAME Updating a local clone after a branch name changesĪfter you rename a branch in a repository on GitHub Enterprise Server, any collaborator with a local clone of the repository will need to update the clone.įrom the local clone of the repository on a computer, run the following commands to update the name of the default branch. Review the information about local environments, then click Rename branch. Next to the branch you want to rename, click. On your GitHub Enterprise Server instance, navigate to the main page of the repository. You should consider adding a new branch with the original content plus an additional commit reporting that the branch name is deprecated and suggesting that users migrate to the new branch name. GitHub Actions workflows do not follow renames, so if your repository publishes an action, anyone using that action with will break. Also, GitHub does not perform any redirects if users perform a git pull for the previous branch name. After the rename is complete, GitHub provides instructions on the repository's home page directing contributors to update their local Git environments.Īlthough file URLs are automatically redirected, raw file URLs are not redirected. Next, click Branches below the header menu. There are two ways you can rename a branch locally. Once logged in, select the repository that contains the branch you would like to delete from the left-hand pane. Branch protection policies are also updated, as well as the base branch for open pull requests (including those for forks) and draft releases. To get started, visit the official GitHub website and log in to your account. ![]() When you rename a branch on your GitHub Enterprise Server instance, any URLs that contain the old branch name are automatically redirected to the equivalent URL for the renamed branch. For more information about branches, see " About branches)." It is not possible to rename a branch from the Github website. You can rename a branch in a repository on your GitHub Enterprise Server instance.
0 Comments
Leave a Reply. |