Home > Back-end >  IntelliJ: Git Push Messed Everything Up
IntelliJ: Git Push Messed Everything Up

Time:09-18

I've been working really hard on a personal project all day, and finally got around to wrapping things up and doing a commit and push. I clicked "Commit" in IntelliJ, and while the prompt for commiting would show up, it wouldn't respond when I clicked on it. Okay, just my luck, I thought. Something's gone wrong and I'm going to lose all of my progress. I didn't panic. I clicked "Commit and Push" and all seemed just fine, until I got an error message about a merge with the main branch not working on Git. What? I didn't ask for a merge! Lo and behold, for some reason it absolutely messed up all of my code and I have no idea why.

All over my files, there's things like "<<<<<<<<<<<<<<<<<<<< HEAD" ">>>>>>>>>>>> ORIGIN" all over the place, and all of the code from my last commit is scattered all throughout my new code. Now I'm having to stay up late and manually go through and erase all of these bizarre lines that have seriously messed everything up.

Am I the only one to ever have a random and super frustating thing like that to happen in IntelliJ?

CodePudding user response:

try using the git revert command to go earlier position wrong before the push was made. (HEAD position can be seen using git reflog). Then, you can try sorting the program using git pull and rebase it with your origin.

  • Related