Home git Is it possible to rename the published branch in the Git?

Is it possible to rename the published branch in the Git?

Author

Date

Category

I created a branch, for example, mycode. Then the necessary changes made, made Commit, Push. Now I thought that I would make some more similar branches with a similar functionality and rename the first in the API_MYCODE. Can this be somehow made?


Answer 1, Authority 100%

To rename a branch downloaded to a remote server, you first need to rename the branch locally, and then unload changes back, deleting the previous branch on the server.

git branch -m old_Ancing new_Ancing
Git Push Origin: Old_Nolding New_Ancing

In the second line, pay attention to the colon in front of the old name of the branch – this is a command for removing the branch on the server.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions