Rajeev
Rajeev

Reputation: 46919

git resolve conflict condition

How to make sure that before checking in files in git there are no conflicts?

Before committing any files if we do:

 git pull origin master 

then do

 git commit
 git push origin master

Is this the case that a user will not get any conflict at all in any case? Please let me know.

Upvotes: 1

Views: 181

Answers (2)

Pascal MARTIN
Pascal MARTIN

Reputation: 401022

Pulling can get you conflicts -- typically, if someone pushed modifications on the same files/lines that you have modified locally ; in such a case, there is no magic : you'll have to resolve the conflict by hand : no program can guess what to do.

Having conflicts is to be expected when several developpers work on the same piece of code.

Upvotes: 1

Sarfraz
Sarfraz

Reputation: 382726

When you do:

git push origin master

The git will let you know if there are any conflicts and won't actually push until that is fixed.

Upvotes: 1

Related Questions