mark15987
mark15987

Reputation: 143

Git conflict markers left after cloning

I have cloned private git repository, the problem is I have a lot of git conflict markers which are causing my code to fail, for example:

<<<<<<< HEAD
            "support": {
                "issues": "https://github.com/phpspec/prophecy/issues",
                "source": "https://github.com/phpspec/prophecy/tree/1.12.2"
            },
=======
>>>>>>> acf658f7bcc5d175d648b7e136daf5efeda3a979

I am looking for a way to remove them all avoiding manually checking each file, I mean if any software that could help by navigating me through all of those markers and displaying options like when in merge.

I have tried to use PHPSTORM but without any success.

Upvotes: 1

Views: 185

Answers (1)

Marcus M&#252;ller
Marcus M&#252;ller

Reputation: 36346

I have cloned private git repository, the problem is I have a lot of git conflict markers which are causing my code to fail, for example:

Well then whoever put the original code there included them and broke the code, and then pushed it in a non-functional state. Write them an email and tell them to fix that, if it's still an option. Not your fault, shouldn't be your problem.

It's often easiest to find the commit where they did that (git blame). It's probably a merge commit, which they didn't do (probably because they don't understand what a git merge is). Then, git reset to the commit before that, do the merge, this time properly. (Here's where you can do "automatically right", but I don't know your merge situation. Git merging isn't hard, read up on it!)

After you've done the merge without leaving all these conflicts in the source code, you then just cherry-pick whatever came after the git merge.

Again, someone checked in code that clearly and obviously was broken, and if it wasn't you, you should be very careful with the code - whoever commanded git didn't care to make sure the things they check in works, even on a basic level.

Upvotes: 1

Related Questions