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

  • SEARCH
  • Home
  • 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 3304470
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:03:55+00:00 2026-05-17T21:03:55+00:00

I have created a local branch X that at some point I pushed to

  • 0

I have created a local branch X that at some point I pushed to remote server (origin)

git push origin X

I realized it’s a bad idea to have branch named X and want it to be called Y
The problem is that I’ve already pushed the branch to the repository.

Is it safe to delete it from the server and push it under a new name like this ?

push origin :X

// 'clone ' the branch under a new name locally ( X-> Y)

push origin Y

What will happen to the people that already fetched from the server. Say that they already
made a branch locally based on the old X name BUT they did not make any changes locally or pushed them to the server for the old X branch.

  • 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-17T21:03:55+00:00Added an answer on May 17, 2026 at 9:03 pm

    other people will keep a pointer to branch X (as origin/X) in their repository until they run git remote prune origin. it’s left as a stale branch

    when fetching/pulling they will get a second point to (newly created) branch Y (as origin/Y)

    branching and merging is not affected by this.

    so, as long as all commits are still reachable from your branch, renaming is fine.

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

Sidebar

Related Questions

I have a local branch work, where I created two new files a.py, b.py
My issue is that I have created a table for a local db in
I have a dev git branch. I made some code changes locally. I haven't
I have a local git repository which tracks a remote SVN repository via git
I have a local git repository created with git svn clone . I make
I have master branch (It is working copy), then some point in time I
I have forgot to create local branch and was working with remote. After making
For a new project I have created a local folder tree with empty Visual
I have a local repository. I created the whole application, but now I want
So I have a local SQLite table breadcrumbs being created on the Android device.

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.