Stuck in a git rebase … how to reset2019 Community Moderator ElectionHow to remove local (untracked) files from the current Git working tree?Undoing a git rebaseWhat is the difference between 'git pull' and 'git fetch'?How to undo 'git add' before commit?How do I undo the most recent commits in Git?How do I check out a remote Git branch?How do I delete a Git branch both locally and remotely?How to revert a Git repository to a previous commitWhat is the best (and safest) way to merge a Git branch into master?How do I rename a local Git branch?

Why Choose Less Effective Armour Types?

Life insurance that covers only simultaneous/dual deaths

If the DM rolls initiative once for a group of monsters, how do end-of-turn effects work?

Look at your watch and tell me what time is it. vs Look at your watch and tell me what time it is

What are substitutions for coconut in curry?

What has been your most complicated TikZ drawing?

How to use deus ex machina safely?

Does Mathematica reuse previous computations?

How do anti-virus programs start at Windows boot?

Is it normal that my co-workers at a fitness company criticize my food choices?

If curse and magic is two sides of the same coin, why the former is forbidden?

How can I track script which gives me "command not found" right after the login?

How to change two letters closest to a string and one letter immediately after a string using notepad++

What approach do we need to follow for projects without a test environment?

Credit cards used everywhere in Singapore or Malaysia?

Existence of subset with given Hausdorff dimension

Why is the President allowed to veto a cancellation of emergency powers?

Employee lack of ownership

Awsome yet unlucky path traversal

Why would a flight no longer considered airworthy be redirected like this?

Identifying the interval from A♭ to D♯

The difference between「N分で」and「後N分で」

Hacking a Safe Lock after 3 tries

Do I need to be arrogant to get ahead?



Stuck in a git rebase … how to reset



2019 Community Moderator ElectionHow to remove local (untracked) files from the current Git working tree?Undoing a git rebaseWhat is the difference between 'git pull' and 'git fetch'?How to undo 'git add' before commit?How do I undo the most recent commits in Git?How do I check out a remote Git branch?How do I delete a Git branch both locally and remotely?How to revert a Git repository to a previous commitWhat is the best (and safest) way to merge a Git branch into master?How do I rename a local Git branch?










6















I am part way through a git rebase and I am stuck. I can't remember exactly what happened but I was using a UI and deleted a checked-out branch and things just seemed to go blank. I restarted and managed to do a bit of other work creating and committing to other branches etc but then I noticed a status saying I was still in the middle of a rebase



If I try



git rebase --skip
git rebase --continue
git rebase --abort


each fail with



error: could not read '.git/rebase-merge/head-name': No such file or directory


Is there a way I can get back to a stable state? I'm really not bothered about what the rebase related to so am not trying to get back to point where I am still in the middle of the rebase.



Edit:



$ git status
On branch fix/SJW-01225
Your branch is up to date with 'core-v3/fix/SJW-01225'.

You are currently rebasing.
(all conflicts fixed: run "git rebase --continue")

Untracked files:
(use "git add <file>..." to include in what will be committed)

[long list of untracked files]

nothing added to commit but untracked files present (use "git add" to track)


Edit-1:



$ touch .git/rebase-merge/head-name

$ git rebase --abort
error: could not read '.git/rebase-merge/onto': No such file or directory

$ touch .git/rebase-merge/onto

$ git rebase --abort
error: could not get 'onto': ''


Thx










share|improve this question
























  • Could you paste what git return when you type git status ?

    – dunajski
    Mar 7 at 14:13











  • Try to create the file: touch .git/rebase-merge/head-name.

    – Maroun
    Mar 7 at 14:22











  • TVM. Edited again following your suggestion

    – Simon Woods
    Mar 7 at 14:25











  • Is this a learning experiment? Perhaps it's git clone time?

    – Karol Dowbecki
    Mar 7 at 14:28







  • 4





    xkcd.com/1597

    – a_horse_with_no_name
    Mar 7 at 14:38















6















I am part way through a git rebase and I am stuck. I can't remember exactly what happened but I was using a UI and deleted a checked-out branch and things just seemed to go blank. I restarted and managed to do a bit of other work creating and committing to other branches etc but then I noticed a status saying I was still in the middle of a rebase



If I try



git rebase --skip
git rebase --continue
git rebase --abort


each fail with



error: could not read '.git/rebase-merge/head-name': No such file or directory


Is there a way I can get back to a stable state? I'm really not bothered about what the rebase related to so am not trying to get back to point where I am still in the middle of the rebase.



Edit:



$ git status
On branch fix/SJW-01225
Your branch is up to date with 'core-v3/fix/SJW-01225'.

You are currently rebasing.
(all conflicts fixed: run "git rebase --continue")

Untracked files:
(use "git add <file>..." to include in what will be committed)

[long list of untracked files]

nothing added to commit but untracked files present (use "git add" to track)


Edit-1:



$ touch .git/rebase-merge/head-name

$ git rebase --abort
error: could not read '.git/rebase-merge/onto': No such file or directory

$ touch .git/rebase-merge/onto

$ git rebase --abort
error: could not get 'onto': ''


Thx










share|improve this question
























  • Could you paste what git return when you type git status ?

    – dunajski
    Mar 7 at 14:13











  • Try to create the file: touch .git/rebase-merge/head-name.

    – Maroun
    Mar 7 at 14:22











  • TVM. Edited again following your suggestion

    – Simon Woods
    Mar 7 at 14:25











  • Is this a learning experiment? Perhaps it's git clone time?

    – Karol Dowbecki
    Mar 7 at 14:28







  • 4





    xkcd.com/1597

    – a_horse_with_no_name
    Mar 7 at 14:38













6












6








6


1






I am part way through a git rebase and I am stuck. I can't remember exactly what happened but I was using a UI and deleted a checked-out branch and things just seemed to go blank. I restarted and managed to do a bit of other work creating and committing to other branches etc but then I noticed a status saying I was still in the middle of a rebase



If I try



git rebase --skip
git rebase --continue
git rebase --abort


each fail with



error: could not read '.git/rebase-merge/head-name': No such file or directory


Is there a way I can get back to a stable state? I'm really not bothered about what the rebase related to so am not trying to get back to point where I am still in the middle of the rebase.



Edit:



$ git status
On branch fix/SJW-01225
Your branch is up to date with 'core-v3/fix/SJW-01225'.

You are currently rebasing.
(all conflicts fixed: run "git rebase --continue")

Untracked files:
(use "git add <file>..." to include in what will be committed)

[long list of untracked files]

nothing added to commit but untracked files present (use "git add" to track)


Edit-1:



$ touch .git/rebase-merge/head-name

$ git rebase --abort
error: could not read '.git/rebase-merge/onto': No such file or directory

$ touch .git/rebase-merge/onto

$ git rebase --abort
error: could not get 'onto': ''


Thx










share|improve this question
















I am part way through a git rebase and I am stuck. I can't remember exactly what happened but I was using a UI and deleted a checked-out branch and things just seemed to go blank. I restarted and managed to do a bit of other work creating and committing to other branches etc but then I noticed a status saying I was still in the middle of a rebase



If I try



git rebase --skip
git rebase --continue
git rebase --abort


each fail with



error: could not read '.git/rebase-merge/head-name': No such file or directory


Is there a way I can get back to a stable state? I'm really not bothered about what the rebase related to so am not trying to get back to point where I am still in the middle of the rebase.



Edit:



$ git status
On branch fix/SJW-01225
Your branch is up to date with 'core-v3/fix/SJW-01225'.

You are currently rebasing.
(all conflicts fixed: run "git rebase --continue")

Untracked files:
(use "git add <file>..." to include in what will be committed)

[long list of untracked files]

nothing added to commit but untracked files present (use "git add" to track)


Edit-1:



$ touch .git/rebase-merge/head-name

$ git rebase --abort
error: could not read '.git/rebase-merge/onto': No such file or directory

$ touch .git/rebase-merge/onto

$ git rebase --abort
error: could not get 'onto': ''


Thx







git rebase






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 14:25







Simon Woods

















asked Mar 7 at 14:07









Simon WoodsSimon Woods

1246




1246












  • Could you paste what git return when you type git status ?

    – dunajski
    Mar 7 at 14:13











  • Try to create the file: touch .git/rebase-merge/head-name.

    – Maroun
    Mar 7 at 14:22











  • TVM. Edited again following your suggestion

    – Simon Woods
    Mar 7 at 14:25











  • Is this a learning experiment? Perhaps it's git clone time?

    – Karol Dowbecki
    Mar 7 at 14:28







  • 4





    xkcd.com/1597

    – a_horse_with_no_name
    Mar 7 at 14:38

















  • Could you paste what git return when you type git status ?

    – dunajski
    Mar 7 at 14:13











  • Try to create the file: touch .git/rebase-merge/head-name.

    – Maroun
    Mar 7 at 14:22











  • TVM. Edited again following your suggestion

    – Simon Woods
    Mar 7 at 14:25











  • Is this a learning experiment? Perhaps it's git clone time?

    – Karol Dowbecki
    Mar 7 at 14:28







  • 4





    xkcd.com/1597

    – a_horse_with_no_name
    Mar 7 at 14:38
















Could you paste what git return when you type git status ?

– dunajski
Mar 7 at 14:13





Could you paste what git return when you type git status ?

– dunajski
Mar 7 at 14:13













Try to create the file: touch .git/rebase-merge/head-name.

– Maroun
Mar 7 at 14:22





Try to create the file: touch .git/rebase-merge/head-name.

– Maroun
Mar 7 at 14:22













TVM. Edited again following your suggestion

– Simon Woods
Mar 7 at 14:25





TVM. Edited again following your suggestion

– Simon Woods
Mar 7 at 14:25













Is this a learning experiment? Perhaps it's git clone time?

– Karol Dowbecki
Mar 7 at 14:28






Is this a learning experiment? Perhaps it's git clone time?

– Karol Dowbecki
Mar 7 at 14:28





4




4





xkcd.com/1597

– a_horse_with_no_name
Mar 7 at 14:38





xkcd.com/1597

– a_horse_with_no_name
Mar 7 at 14:38












1 Answer
1






active

oldest

votes


















6














To escape from corrupted git rebase you can do the following



  1. Reset to a known state. You can find out from which commit you started your rebase with git reflog.

For example, reflog will give you the following. The rebase starting point is the last rebase (start) or rebase -i (start) if you did an interactive rebase. Here it is HEAD@1:



$ git reflog
f10ccfed (HEAD) HEAD@0: rebase : fast-forward
383aa038 (origin/master, origin/HEAD) HEAD@1: rebase (start): checkout HEAD~10
0600cf7e (origin/Files, master, Files) HEAD@4: checkout: moving from master to Files
0600cf7e (origin/Files, master, Files) HEAD@5: commit: fixes
f10ccfed (HEAD) HEAD@6: commit: refactoring


So what you need is:



 git checkout master # assuming you were on master
git reset --hard HEAD@1


  1. Remove the rebase-merge folder

 rm -rf .git/rebase-merge





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55045740%2fstuck-in-a-git-rebase-how-to-reset%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    6














    To escape from corrupted git rebase you can do the following



    1. Reset to a known state. You can find out from which commit you started your rebase with git reflog.

    For example, reflog will give you the following. The rebase starting point is the last rebase (start) or rebase -i (start) if you did an interactive rebase. Here it is HEAD@1:



    $ git reflog
    f10ccfed (HEAD) HEAD@0: rebase : fast-forward
    383aa038 (origin/master, origin/HEAD) HEAD@1: rebase (start): checkout HEAD~10
    0600cf7e (origin/Files, master, Files) HEAD@4: checkout: moving from master to Files
    0600cf7e (origin/Files, master, Files) HEAD@5: commit: fixes
    f10ccfed (HEAD) HEAD@6: commit: refactoring


    So what you need is:



     git checkout master # assuming you were on master
    git reset --hard HEAD@1


    1. Remove the rebase-merge folder

     rm -rf .git/rebase-merge





    share|improve this answer





























      6














      To escape from corrupted git rebase you can do the following



      1. Reset to a known state. You can find out from which commit you started your rebase with git reflog.

      For example, reflog will give you the following. The rebase starting point is the last rebase (start) or rebase -i (start) if you did an interactive rebase. Here it is HEAD@1:



      $ git reflog
      f10ccfed (HEAD) HEAD@0: rebase : fast-forward
      383aa038 (origin/master, origin/HEAD) HEAD@1: rebase (start): checkout HEAD~10
      0600cf7e (origin/Files, master, Files) HEAD@4: checkout: moving from master to Files
      0600cf7e (origin/Files, master, Files) HEAD@5: commit: fixes
      f10ccfed (HEAD) HEAD@6: commit: refactoring


      So what you need is:



       git checkout master # assuming you were on master
      git reset --hard HEAD@1


      1. Remove the rebase-merge folder

       rm -rf .git/rebase-merge





      share|improve this answer



























        6












        6








        6







        To escape from corrupted git rebase you can do the following



        1. Reset to a known state. You can find out from which commit you started your rebase with git reflog.

        For example, reflog will give you the following. The rebase starting point is the last rebase (start) or rebase -i (start) if you did an interactive rebase. Here it is HEAD@1:



        $ git reflog
        f10ccfed (HEAD) HEAD@0: rebase : fast-forward
        383aa038 (origin/master, origin/HEAD) HEAD@1: rebase (start): checkout HEAD~10
        0600cf7e (origin/Files, master, Files) HEAD@4: checkout: moving from master to Files
        0600cf7e (origin/Files, master, Files) HEAD@5: commit: fixes
        f10ccfed (HEAD) HEAD@6: commit: refactoring


        So what you need is:



         git checkout master # assuming you were on master
        git reset --hard HEAD@1


        1. Remove the rebase-merge folder

         rm -rf .git/rebase-merge





        share|improve this answer















        To escape from corrupted git rebase you can do the following



        1. Reset to a known state. You can find out from which commit you started your rebase with git reflog.

        For example, reflog will give you the following. The rebase starting point is the last rebase (start) or rebase -i (start) if you did an interactive rebase. Here it is HEAD@1:



        $ git reflog
        f10ccfed (HEAD) HEAD@0: rebase : fast-forward
        383aa038 (origin/master, origin/HEAD) HEAD@1: rebase (start): checkout HEAD~10
        0600cf7e (origin/Files, master, Files) HEAD@4: checkout: moving from master to Files
        0600cf7e (origin/Files, master, Files) HEAD@5: commit: fixes
        f10ccfed (HEAD) HEAD@6: commit: refactoring


        So what you need is:



         git checkout master # assuming you were on master
        git reset --hard HEAD@1


        1. Remove the rebase-merge folder

         rm -rf .git/rebase-merge






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 7 at 20:51









        msanford

        6,76664666




        6,76664666










        answered Mar 7 at 14:52









        nowoxnowox

        6,693934105




        6,693934105





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55045740%2fstuck-in-a-git-rebase-how-to-reset%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived