Quantcast
Channel: Renaming branches remotely in Git - Stack Overflow
Browsing all 11 articles
Browse latest View live

Answer by rNkL for Renaming branches remotely in Git

To change the branch name follow the below steps:git branch -m old_branchname new_branchnamegit push origin :old_branchname new_branchnamegit push --set-upstream origin new_branchnameAfter that fetch...

View Article



Answer by arthur bryant for Renaming branches remotely in Git

I don't know why but @Sylvain Defresne's answer does not work for me.git branch new-branch-name origin/old-branch-namegit push origin --set-upstream new-branch-namegit push origin :old-branch-nameI...

View Article

Image may be NSFW.
Clik here to view.

Answer by Pober Wong for Renaming branches remotely in Git

If you're using Github...You can create a new branch based on old-name branch using the UI on github.com:

View Article

Image may be NSFW.
Clik here to view.

Answer by CPHPython for Renaming branches remotely in Git

TL;DR"Renaming" a remote branch is actually a 2 step process (not necessarily ordered): deletion of the old remote branch (git push [space]:<old_name> as ksrb explained);push into a new remote...

View Article

Answer by myzzzl for Renaming branches remotely in Git

Adding to the answers already given, here is a version that first checks whether the new branch already exists (so you can safely use it in a script)if git ls-remote --heads "$remote" \ | cut -f2 \ |...

View Article


Answer by EpicPandaForce for Renaming branches remotely in Git

I don't know if this is right or wrong, but I pushed the "old name" of the branch to the "new name" of the branch, then deleted the old branch entirely with the following two lines:git push origin...

View Article

Answer by sschuberth for Renaming branches remotely in Git

If you really just want to rename branches remotely, without renaming any local branches at the same time, you can do this with a single command:git push <remote>...

View Article

Answer by Shashank Hegde for Renaming branches remotely in Git

First checkout to the branch which you want to rename:git branch -m old_branch new_branchgit push -u origin new_branchTo remove an old branch from remote:git push origin :old_branch

View Article


Answer by Sylvain Defresne for Renaming branches remotely in Git

You just have to create a new local branch with the desired name, push it to your remote, and then delete the old remote branch:$ git branch new-branch-name origin/old-branch-name$ git push origin...

View Article


Answer by Lily Ballard for Renaming branches remotely in Git

Sure. Just rename the branch locally, push the new branch, and push a deletion of the old.The only real issue is that other users of the repository won't have local tracking branches renamed.

View Article

Renaming branches remotely in Git

If there is a repository that I only have git:// access to (and would usually just push+pull), is there a way to rename branches in that repository in the same way that I would do locally with git...

View Article
Browsing all 11 articles
Browse latest View live


Latest Images