After I type ‘git reverse <hash of the commit from github>’ in the terminal of vscodium, it always throws this message at me.

Auto-merging app/build/posts.html
CONFLICT (content): Merge conflict in app/build/posts.html
error: could not revert 0cc6763... new blog
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git revert --continue".
hint: You can instead skip this commit with "git revert --skip".
hint: To abort and get back to the state before "git revert",
hint: run "git revert --abort".
hint: Disable this message with "git config advice.mergeConflict false"

Then as the hints say, I type ‘git status’, fix the error, then commit and push again. But again the same message shows and I have no idea what to do. Getting mad as a beginner.

As i found no useful guides online, please help me to fix this issue without AI.

  • Chewt@beehaw.org
    link
    fedilink
    arrow-up
    1
    ·
    2 days ago

    It’s hard to say what the issue is since we are lacking some context. Have you made changes and commits after the commit you are trying to revert, or was that commit the most recent commit in the history?

    Same with the fixes you mention, what exactly did you do to fix the merge conflict? Did you manually fix the files with the conflicts? Since you mention being a beginner with git, a common mistake would be not actually going into the files and resolving the conflicts, and just immediately doing git add/rm on the conflicting files.

    I’m happy to walk you through the process if you could give a few more details, git can be complicated when you’re a beginner :)

    • tumbling4986@lemmy.caOP
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Yes, I needed to revert back to a commit that done around 2 weeks ago. Approximately 5-6 commits behind.

      I fixed the merge conflict by going to the specific file it mentioned which is /app/build/posts.html. And on the code line vscodium suggested me to recover multiple lines of code i previously deleted from the html file. I recovered the deleted lines of code and performed a commit and push.

      Now the issue is fixed by using git reset --hard commit_hash which is mentioned by another commenter.

      Thank you for trying to help.