How to solve git conflict, which is generate when we push same script from two machines into same branch?

facing issue when we try to push same script from two machines, its showing conflict error.

There is no magic spell that resolves a merge conflict automagically.

I do not see how you will be able to resolve the merge conflict that you encountered. Because I have no access to your system; because I can not see any detail information, such as which file(s) got conflicts and how these files are marked; because I do not see how you want to edit the files in the end.

It is only you who can resolve the conflict. Nobody in this forum would be able to help you.

Perhaps you haven’t studied Git yet. If so, you need to study Git by reading through some good tutorials; such as

This article explains Git as a commanline tool, not in GUI. That’s good. It is far easier to understand Git in commandline than GUI.

Once you got through this tutorial from section1 to section10, then you will understand why you got a merge conflict, how to prevent it, how to resolve it.

Also, extensive Git courses are available, e.g,

If you search Google with “git conflict how to resolve”, then you will find a lot of readings. However, these articles assumes that readers are already familiar with Git. I would recommend you to start with learning the basics of git before jumping into these “how to” articles.


Here’s my 2p worth for you.

You didn’t mention what the conflicts were. When multiple people work on the same code you have the risk of conflict - I’ve had innocuous things before like differences in a config file which just have things like last updated by etc.

If you are getting conflicts on your automation code then this is different and you need to look at why.
Why are >1 person working on the same code? Could this be avoided
But ultimately only you can resolve the conflict as you need to decide whether you accept the source or the target - and the right answer there is something only you can decide