How to fix "You are in the middle of an am session" in a git branch?

Viewed 246

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...

1 Answers

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...

Related