Search code examples
branchtortoisegit

How to rename a remote branch using TortoiseGit?


I have seen a few questions about this, like:

How do I rename both a Git local and remote branch name?

But I am using TortoiseGit.

As you can see:

Branches

I recently renamed my local branch from ImportPTS to import-publictalk-names. I have just pushed my commit from the new named branch to the existing remote named branch.

But I would like the remote named branch to match. Can we do this with TortoiseGit? I tried with the Browser Ref window and couldn't see it.


Solution

  • Open the push dialog and enter a different name for "remote branch". In order to automatically select the name branch for pushing and pulling, also select "Set upstream/track remote branch". After that the old remote branch can be deleted (e.g., using the log dialog).

    Remote branches exist in the remote repository, but also have a "local" corresponding branch named remotes/NAME/branchname. Additionally, you have local branches which can have a remote tracked branch, which is a branch name which exists on a remote repository and which is used automatically for pulling and pushing.