Search code examples
gitbitbucketgit-reset

Git remote is ahead by one commit that I can't fetch locally or reset


After some rebasing and hard resets I ended up with a commit in my repository that I can't track locally.

My repository on bitbucket looks like this

enter image description here

While the last commit on my local repository is a255675. I'm trying to revert the remote head to a255675 by doing:

 git reset --hard a255675
 git push -f origin master

But the response is :

Everything up-to-date

Doing a git fetch origin followed by a git reset --hard origin/master gives this response:

HEAD is now at a255675

Commits a255675 and 25b290e are in fact identical in terms of changes and essentially I just want to reset the remote head to a255675.

Why doesn't it work and how can I achieve this?


Solution

  • Remove the git-tag 0.2.9 which is ahead of your current local commit

       git push origin :0.2.9
    

    It will resolve the issue.