2

Issue

Setup

git version 2.17.1

Problem

I have an issue in a branch origin/dev_xxx of a git repository. I don't remenber how I got the following status (I didn't used git am) :

$ git status
On branch dev_xxx
Your branch is up to date with 'origin/dev_xxx'.

You are in the middle of an am session.
The current patch is empty.
  (use "git am --skip" to skip this patch)
  (use "git am --abort" to restore the original branch)

nothing to commit, working tree clean
$ git am --abort
fatal: could not parse author script

I would like to come back to the original state of the branch.

I read the following discussion but it doesn't answer to my issue (The current patch is empty) [What does "You are in the middle of an am session" mean?

Tests

To fix the issue I tried the following solutions with no success :

git am --skip or --abort
fatal: could not parse author script
git reset --hard dev_xxx

Each time I have still the status : You are in the middle of an am session...

  • That particular `fatal: could not parse ...` is a Git bug. I'm not sure if it's fixed in a more current Git, though. (The `abort` should finish even if there's something else wrong.) – torek Oct 15 '19 at 01:34
  • Update: some tests for similar failures were introduced in Git 2.19, and Git 2.19 definitely fixes related bugs. It may also fix this one. Try updating to 2.19 or newer. – torek Oct 15 '19 at 01:39

1 Answers1

1

Never been stuck in such a place but you may be able to get out by deleting a folder called rebase-apply or am-apply or something like this under your .git folder.

If you are not used to git, you can post the result of: ls -al .git

We will see what seems to be relevant...