Problem
I incorrectly merged the code I pulled from the upstream group project repository. I commited the merge to my local repo and pushed it to my fork of the project on my github.
Goals
- Reset my local repo back to the commit I want
- Redo the merge
- Push new merge commit up my fork of the project on github so I can later make a pull request on the group project repo
Solution
- git log “find the <sha> of the commit I want”
- git reset —hard <sha> “change my local repo to the version of the commit i want”
- git push “trigger merge. do the merge correctly”
- git add “adds merged file to commit”
- git commit “commits code to local repo”
- git push —force origin master “forces my local commits to override what is commited in my github fork of the project”
After all those steps, I checked my github fork of the project to see that my fixed merge was there and that I could make a pull request on the group project repo without a merge conflict.