Hope you liked this article and found it useful, feel free to comment with your thoughts and opinions and stay connected with me here and on Twitterâ¡. However, you canât directly rename a remote branch as you need to push the renamed local branch to the remote repository and then delete the old branch from there. Renaming a local Git Branch is just a matter of running a single âgit branch -mâ command. Now if you want to check the changes then you can login to your GitHub or GitLab or whatever the git client portal you are using and see the changes there. If your local branch is already pushed to a remote repository and you want to rename it and reset the upstream branch then this command will help you to rename it. You will see the changes, isnât it is so simple â¡ Rename remote git branch Now check your current branch name by hitting git status If you are under another branch and want to rename the branch then hit the below command. If you are already in the local branch which you wanted to rename, you can hit this command. If youâve already pushed the branch to the remote.At this point, you have renamed the local branch. Rename the local branch by typing: git branch -m . I will share the solutions to rename the git branch locally and under the remote. Follow the steps below to rename a Local and Remote Git Branch: Start by switching to the local branch which you want to rename: git checkout .Earlier, I faced the same situation where I wanted to rename the git branch locally and on remote, and luckily I found that git allows us to rename the branch very easily, lets see how. Have you ever wondered or come across a situation where you want to rename a Git branch? If yes then this article will help you with that.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |