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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:06:28+00:00 2026-05-24T10:06:28+00:00

I’ve been working on my local master branch on a new feature that is

  • 0

I’ve been working on my local master branch on a new feature that is not yet ready to be pushed live for production. However, I just discovered a separate bug in my live app, and so I quickly fixed it locally. However, I want to push this bug fix to my remote master branch without pushing this new feature I’ve been working on. How might I do this?

  • 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-24T10:06:29+00:00Added an answer on May 24, 2026 at 10:06 am

    Less serious answer:

    By going back in time and using a proper branch model for your development. Stop working on your production branch and start using feature branches. The situation you describe is exactly why you should be using branches: The ability to set your development work aside, check out master, perform bug fixes and return to your development branch. By ignoring branching, you’re ignoring a lot of what makes Git awesome.

    More serious answer:

    More practically, you can reorder the commits, point your local master to the one you want to push, push, and then check out your development commit as a new branch.

    If your commit history looks like this:

    A <-- (master) bug fix, you want to push this
    B <-- you don't want to push this
    C <-- (origin/master)
    

    You can use git rebase -i HEAD~2 to re-order the last two commits to look like this (just switch the order of the lines in the editor that comes up):

    B <-- (master) you don't want to push this
    A <-- bug fix
    C <-- (origin/master)
    

    Make a note of the SHA1 of B, you’re about to temporarily cut it out of your master branch. Once you’ve recorded the SHA1, you can use git update-ref refs/heads/master [SHA1 of A], which results in

    A <-- (master) bug fix
    C <-- (origin/master)
    

    You can now git push to merge A into origin/master and send the results to origin.

    Lastly, to get your development work (commit B) back, create a new development branch (which you should have done in the first place) pointing at your B commit: git branch development [SHA1 of B]

    Your repository will now look like this:

    B <-- (development) you don't want to push this
    A <-- (master,origin/master) bug fix
    C <-- where origin/master *was* before pushing
    

    When you’re ready to have that development work merged into master, you can:

    git checkout master
    git merge development
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into

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.