Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6889469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:09:36+00:00 2026-05-27T06:09:36+00:00

I have a branch I’ve already pushed to github using –set-upstream. I want to

  • 0

I have a branch I’ve already pushed to github using –set-upstream. I want to rename it now, and have that change reflected on github. Here’s what I want to do

git branch -m oldbranch newbranch
git push origin :oldbranch
git push --set-upstream newbranch

Running ‘branch -m’ doesn’t update my .git/config apart from changing the branch to ‘newbranch’. branch.newbranch.merge is still ‘refs/heads/oldbranch’. When I push if I issue the command

git push --set-upstream origin newbranch 

is that going to properly update my .git/config? Any potential impact on other users? No one else is currently committing to the branch, and I don’t think anyone’s even checked it out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:09:37+00:00Added an answer on May 27, 2026 at 6:09 am

    Yes, that should push newbranch to origin and update the upstream info. If you want to be really explicit, you can use git push --set-upstream origin newbranch:newbranch.

    As for impacting other users, you’re proposing to delete the original branch (oldbranch) and create a new branch (newbranch). They just happen to have the same names. However, other users won’t “magically” get the branch name change. Anyone who’s following your oldbranch will see the branch get deleted, and anyone who blindly pushes their copy of oldbranch may inadvertently re-create the branch on the server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using git. I have a branch, apifixes , that was branched from master
I have a branch model that consists of parent_id and child_id. I want to
For instance, suppose I have a branch that I want to update with the
I have a branch in SVN that I want to keep up to date
Previously, using SVN, I would have a branch that was my development branch, which
I have created a local branch X that at some point I pushed to
Using subversion 1.5 I have branch B which was branched off of branch A.
I have a branch in a badly structured svn repo that needs to be
Somehow my master and my origin/master branch have diverged. I actually don't want them
I have a remote project that have a branch. So I first clone the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.