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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:56:08+00:00 2026-06-03T12:56:08+00:00

I have a typical problem which is like the following: 1) I was working

  • 0

I have a typical problem which is like the following:

1) I was working on an Issue X, I made 2 commits for that issue, but I was stuck in between and did not push the changes to my remote repo.

My git status on master branch says that

Your branch is ahead by 2 commits.

2) I am now assigned a new task and I want to push the 2 commits which I did in the master branch in a local branch which I would create now.

I tried achieving the same as :
1) git log (on master and noted the commit nos lets call them 1111(for commit 1, old commit) and 2222(for commit 2, newest commit)
2) git checkout -b my_local_branch
3) git cherry-pick 1111

Now, there are conflicts. Can someone tell me what is it that I should do. Maybe apply the newest commit because I feel that my local branch does not have those commits (I might be wrong), because when I do

git status (on my local_branch), I don’t see that my branch is ahead of any commit.

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-03T12:56:11+00:00Added an answer on June 3, 2026 at 12:56 pm

    I guess this will work.

    On your master branch, run git branch -b my-local. Check that your commit 1111 and 2222 are O.K.

    Go back to master branch: git checkout master.

    Run git rebase -i, and delete commit 1111 and 2222.

    Now master branch got rid of 1111 and 2222, you can start your new task. (And commmit 1111 and 2222 are in your my-local branch.)

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

Sidebar

Related Questions

I have to fix a typical memory leak, Problem is like that : typedef
I have a typical enterprise/business application that I am developing that includes orders, salespersons,
I have a typical dev scenario: I have a SQL 2008 database that I
I have a typical form_for for registering user. But in the end I would
I have a continuous linear programming problem that involves maximizing a linear function over
I'm having what at first looks like a typical margin related jerking problem with
A typical producer-consumer problem is solved in python like below: from queue import Queue
I have an issue with a layout which only occurs with ie6 or 7
I have a custom view that contains several views in itself. I've made it
I met a problem like this. class A have a list of class B.

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.