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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:54:56+00:00 2026-06-06T17:54:56+00:00

I did a few commits, say commit A, B, C Now I want to

  • 0

I did a few commits, say commit A, B, C
Now I want to push only commit A and B to the remote repo. (And keep commit C to be merged and pushed at a later time)
Before I push, I need to run:

git fetch origin master
git rebase --merge FETCH_HEAD

problem is the above commands will ask me to resolve conflicts of commit C as well, which I’m not planning to push now.

Is it possible to do the rebase without having to deal with commit C.

Thanks

  • 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-06-06T17:54:58+00:00Added an answer on June 6, 2026 at 5:54 pm

    Saving before the rebase

    The easiest way to save the commit so you can postpone dealing with the conflicts would be to tag it so you have a reference to the commit later:

    $ git tag save-commitC <sha1>
    

    Rebasing without commit C

    After you’ve saved a reference, rebase without the commit:

    $ git rebase --interactive --merge FETCH_HEAD
    

    It should open your editor to file looking like this:

    pick <sha1> <message>
    pick <sha1> <message>
    pick <sha1> <message>
    ...
    

    To delete commit C from this branch’s history, simply remove or comment out the commit’s pick <sha1> <message> line.

    Note that commits are listed in reverse order, with the oldest commits first, the most recent ones last. The first commit on the list should be the first commit that is not an ancestor of FETCH_HEAD.

    Once you’ve rebased without C, go ahead and push:

    $ git push origin master
    

    Reapplying the commit

    When you’re ready to apply it on the rebased branch:

    $ git cherry-pick save-commitC
       # resolve merge conflicts
    $ git commit
    $ git tag -d save-commitC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an old commit that I did a few weeks ago. I want
github showing 13th April's commit as my last commit. I just did push few
I want to retrieve old Google searches which I did a few years/months back
I'm using git with my friend. I did a few commits and my friend
I am new to RabbitMQ. I just started yesterday. I did few spikes on
i did a few searches and i saw a few people try to do
I've searched quite a bit and found a few solutions that did not end
I'm getting an odd error when I try to push to a new remote
I did an evil thing in github: used rebase, then push --force. This was
I had a private branch that I did a ton of commits to, then

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.