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

            Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

            Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

            How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page