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?
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
|
show 1 more comment
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
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'sgit clone
time?
– Karol Dowbecki
Mar 7 at 14:28
4
xkcd.com/1597
– a_horse_with_no_name
Mar 7 at 14:38
|
show 1 more comment
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
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
git rebase
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'sgit clone
time?
– Karol Dowbecki
Mar 7 at 14:28
4
xkcd.com/1597
– a_horse_with_no_name
Mar 7 at 14:38
|
show 1 more comment
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'sgit 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
|
show 1 more comment
1 Answer
1
active
oldest
votes
To escape from corrupted git rebase
you can do the following
- Reset to a known state. You can find out from which commit you started your
rebase
withgit 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
- Remove the
rebase-merge
folder
rm -rf .git/rebase-merge
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
To escape from corrupted git rebase
you can do the following
- Reset to a known state. You can find out from which commit you started your
rebase
withgit 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
- Remove the
rebase-merge
folder
rm -rf .git/rebase-merge
add a comment |
To escape from corrupted git rebase
you can do the following
- Reset to a known state. You can find out from which commit you started your
rebase
withgit 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
- Remove the
rebase-merge
folder
rm -rf .git/rebase-merge
add a comment |
To escape from corrupted git rebase
you can do the following
- Reset to a known state. You can find out from which commit you started your
rebase
withgit 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
- Remove the
rebase-merge
folder
rm -rf .git/rebase-merge
To escape from corrupted git rebase
you can do the following
- Reset to a known state. You can find out from which commit you started your
rebase
withgit 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
- Remove the
rebase-merge
folder
rm -rf .git/rebase-merge
edited Mar 7 at 20:51
msanford
6,76664666
6,76664666
answered Mar 7 at 14:52
nowoxnowox
6,693934105
6,693934105
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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