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 999421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:20:58+00:00 2026-05-16T07:20:58+00:00

I created a feature branch off master and worked for a long while. I

  • 0

I created a “feature” branch off master and worked for a long while. I then fetched the latest master branch commits and rebased my “feature” branch commits on top of it. Then I merged “feature” into master. However, I forgot about the merge and continued committing into the “feature” branch. I want those commits in a new branch now, so I would now like to create another branch, “feature_2”, that is based on the commits on the “feature” branch since the last merge into master. Any suggestions?

  • 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-16T07:20:59+00:00Added an answer on May 16, 2026 at 7:20 am

    Considering that:

    • feature already references commits since last merge into master
    • branches are just pointers
    x--x--x (master)
           \
            y--y--y (feature)
    

    , you can simply:

    • git checkout feature
    • git checkout -b feature2
    • git branch -f feature master
      (provided no commits were made on master since the feature merge)
    x--x--x (master, feature)
           \
            y--y--y (feature2)
    

    All the commits from master are no longer referenced by feature (which is reset to where master is), but are now accessible through feature2 (which is where feature is before being reset to master)


    The OP Chip Castle adds:

    I have 3 other team members who have had their branches merged into master since then, so I don’t want to merge the same commits I have already merged.
    I was hoping to give a SHA range only for the commits I need from feature to a new branch. Is there any way to do that or a better way?

    So the situation is:

    x--x--x--y'--y' (master, updated after a fetch from other repo)
           \
            y'--y'--y--y (feature, with y' being already merged, 
                          and y being the commits I need)
    

    Then you can simply rebase feature on top of master: identical commits will be ignored.

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

Sidebar

Related Questions

Say I created a feature-x branch and merged or rebased with master branch. Now
We have worked on a feature branch the last six months. Most commits made
I have created a branch like this svn copy svn+ssh://foo.bar/svn/myproject/trunk svn+ssh://foo.bar/svn/myproject/branches/feature-x I then proceeded
I've had a long-running feature branch that needs to be merged back into the
I've created a feature branch to work in parallel with the trunk. In the
So I usually create a feature branch in git, work on it, then merge
I needed to do some feature development on a branch, so I created one
If I create a branch in SVN off trunk rev 10 then realized that
Suppose I was on master branch and created a new branch: git checkout -b
I created a new branch in XCode to build a new feature. After some

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.