How to remove single commit in Git?

Someone fixed a bug in a program on Github, but it was not added to the main branch. I just want to pull this commit, but everything I tried gives an error talking about a bad object.

+4
source share
1 answer

It would be easier:

  • git fetch (brings everything locally)
  • git cherry-pick <SHA1 of the right commit>

Once the choice is made, you can make a cherry-pick commit that fixes the error (it should be part of git log origin/xxx, with xxxis the branch where the error correction was fixed on the GitHub side)

, master, push git GitHub master.


:

git remote add otherfork /url/to/other/fork
git fetch otherfork
git cherry-pick <commit>
+9

All Articles