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:
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.
To be precise, renaming a remote branch is not direct – you have to delete the old remote branch name and then push a new branch name to the repo. Step 2: Reset the upstream branch to the name of your new local branch by running git push origin -u new-branch-name .
The steps to change a git branch name are: Rename the Git branch locally with the git branch -m new-branch-name command. Push the new branch to your GitHub or GitLab repo. Delete the branch with the old name from your remote repo.
If you want to do a simple in-place rename of a file or folder, use Context Menu → Rename... Enter the new name for the item and you're done.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With